Bar Charts vs Histograms
One for categories, one for numbers. They look similar but are not the same.
Key Points
- Bar chart = categorical x‑axis. Bars have gaps. Order can be rearranged.
- Histogram = numerical x‑axis. Bars touch. Order is fixed by number line.
- Bar chart height = count or value per category.
- Histogram bar height = frequency of data points in that bin.
- Bin width in histogram changes the story. Experiment with it.
- Use bar charts for things like 'sales by product'. Use histograms for 'distribution of ages'.
What it is
Bar charts are for categorical data. Each bar is a separate category (like 'red', 'blue', 'green'). Histograms are for numerical data. Bars touch because the x‑axis is a continuous number line (like ages 0‑10, 10‑20). In a histogram, you can change the bin width. In a bar chart, categories are fixed. Use the wrong one and you'll confuse your audience or obscure patterns.
Why it exists
Many beginners treat histograms as bar charts and reorder bins, which breaks the meaning of the number line. Or they treat bar charts as histograms and leave gaps where there shouldn't be. The distinction forces you to think: is this variable categorical or numerical?
Intuition
When to use
- Bar chart: comparing counts or percentages across categories (e.g., sales by region, survey responses).
- Histogram: exploring distribution of a single numerical variable (e.g., age, income, time).
Common mistakes
- Using a histogram for categorical data – the bars touch, implying order that doesn't exist.
- Using a bar chart for numerical data with gaps – it implies categories, hiding continuity.
- Choosing bad bin sizes in histograms: too few bins hide shape, too many show noise.
Notes
- Pareto charts are bar charts sorted descending with a cumulative line – useful for prioritizing.
- For ordinal categories (like 'small', 'medium', 'large'), a bar chart with natural order is fine, but keep gaps.
In practice
Bar charts are used in reports and dashboards constantly. Histograms are EDA staples. Both are available in every plotting library (Matplotlib, Seaborn, Plotly, Tableau).
Was this concept helpful?
Related concepts