Skip to main contentSkip to solution

We can display the whisker in a box plot, in the horizontal direction by adding a parameter _________ .

Solution

✅ Correct Option: 2

In Matplotlib, the vert parameter of boxplot() controls the orientation of the box plot. By default it is True, which draws vertical boxes. Setting vert=False draws the boxes and whiskers horizontally.

Example: plt.boxplot(data, vert=False)


Option 1: vert=True is the default, so it gives the usual vertical plot.

Options 3 and 4: vert accepts only a boolean value, so Axis and Horizontal are not valid.

Keyboard Shortcuts

  • Left arrow: Previous question
  • Right arrow: Next question
  • S key: Jump to solution
  • Q key: Jump to question