Skip to main contentSkip to solution

Which of the following commands is used to plot horizontal bar?

Solution

✅ Correct Option: 3

The value 'barh' (bar horizontal) is the valid kind for horizontal bar charts. It draws the bars along the x-axis with categories on the y-axis.


Option 1: kind='bar' draws vertical bars.

Options 2 and 4: 'hbar' and 'horizontal' are not valid kind values.

The kind argument belongs to pandas .plot() (for example df.plot(kind='barh')). In plain matplotlib, the equivalent is plt.barh().

Keyboard Shortcuts

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