CHAPTER 06
Beginner
Bar Charts and Categorical Data
Updated: May 18, 2026
5 min read
# CHAPTER 6
Bar Charts and Categorical Data
1. Chapter Introduction
Bar charts are the workhorse of categorical comparison — which product sells most, which region performs best, which department has the highest headcount. This chapter covers all four bar chart types with production-quality styling.2. Vertical Bar Chart
python
3. Horizontal Bar Chart (Best for Long Labels)
python
4. Grouped Bar Chart
python
5. Stacked Bar Chart
python
6. Common Mistakes
- Unsorted bars: Random order is hard to rank. Sort by value (descending) for immediate insight — the only exception is when category order is meaningful (months, weekdays).
- Starting Y-axis above zero: Bar charts MUST start at zero — bar length encodes value. Truncating the Y-axis makes small differences look enormous.
7. MCQs
Question 1
Horizontal bar is preferred when?
Question 2
ax.barh() creates?
Question 3
Grouped bar chart compares?
Question 4
Stacked bar shows?
Question 5
Bar charts MUST start Y-axis at?
Question 6
bottom=online in stacked bar?
Question 7
Best practice for bar ordering?
Question 8
Adding value labels on bars uses?
Question 9
Bar width of 0.6 means bar occupies?
Question 10
edgecolor='white' in bar chart?
8. Interview Questions
- Q: When would you use a stacked bar chart vs a grouped bar chart?
- Q: Why should a bar chart's Y-axis always start at zero?