Vertical and Horizontal Bar Charts
Vertical and Horizontal Bar Charts
Bar charts are essential for comparing values across categories. Let's master both vertical and horizontal bar charts.
Basic Vertical Bar Chart
Loading Python Playground...
Horizontal Bar Chart
Better for long category names or many categories:
Loading Python Playground...
Customizing Bar Colors
Use different colors to highlight specific bars:
Loading Python Playground...
Bar Width and Spacing
Control the appearance of your bars:
Loading Python Playground...
Sorted Bar Charts
Sort bars for easier comparison:
Loading Python Playground...
Negative Values
Handle bars that go both directions:
Loading Python Playground...
Waterfall Charts
Show cumulative effect of values:
Loading Python Playground...
Practice: Create a Performance Bar Chart
Loading Python Exercise...
Key Takeaways
- Use
bar()for vertical bars andbarh()for horizontal bars - Horizontal bars work better for long category names
- Control bar width with the
widthparameter - Add value labels using
ax.text()positioned relative to bars - Use color to encode additional information (performance levels, positive/negative)
- Sort bars for easier comparison of values
- Reference lines (
axhline,axvline) provide context
In the next lesson, we'll explore grouped and stacked bar charts for comparing multiple series.

