Question:

Which attribute is added to display whisker in horizontal direction in the boxplot?

Show Hint

Remember: "vert" is short for "vertical".
Setting it to False naturally switches the boxplot orientation to horizontal.
This is a highly tested parameter in CBSE and CUET exams.
Updated On: Jun 11, 2026
  • vert=True
  • vert="H"
  • vert=False
  • vert=1
Show Solution
collegedunia
Verified By Collegedunia

The Correct Option is C

Solution and Explanation




Step 1: Understanding the Question:

The question asks for the specific parameter/attribute in Matplotlib's boxplot function that allows the user to orient the plot horizontally.
By default, box plots are drawn vertically, but we can change this orientation using a boolean parameter.



Step 2: Key Formula or Approach:

In the Python Matplotlib library, the function matplotlib.pyplot.boxplot() is used to create a box-and-whisker plot.
The parameter vert controls the orientation of the boxplot.
It accepts a boolean value: True for vertical and False for horizontal.



Step 3: Detailed Explanation:

A boxplot is a standardized way of displaying the distribution of data based on a five-number summary: minimum, first quartile (Q1), median, third quartile (Q3), and maximum.
When plotting a boxplot using Matplotlib, the default orientation is vertical because the default value of the vert parameter is True.
When vert is set to True, the box lies vertically, and the whiskers extend up and down along the y-axis.
If we want to display the boxplot horizontally, where the box lies along the x-axis and the whiskers extend left and right, we must set the vert parameter to False.
Other options such as vert="H" or vert=1 are syntactically incorrect or do not produce a horizontal boxplot.
Therefore, using vert=False is the standard way to achieve a horizontal orientation in Matplotlib boxplots.



Step 4: Final Answer:

The correct parameter to render the whiskers and the box in a horizontal direction is vert=False.
Was this answer helpful?
0
0