Which of the following commands is used to plot horizontal bar?
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().
Related questions:
2026: 23 May Shift 2
2026: 19 May Shift 1
2025: 3 June Shift 2