Choosing the right chart
Last updated
Some charts are easier to read accurately than others, and it isn't a matter of taste: it has been measured. In this lesson you'll sort questions into five jobs a chart can do, test your own eyes on bars, a pie and bubbles, learn the ranking that explains your results, and turn a twelve-slice pie into a chart someone can actually read.
By the end of this lesson you can
- Name the job a question needs: comparison, distribution, relationship, composition or change
- Explain why position beats angle, and angle beats area
- Replace a hard-to-read pie with sorted bars
Five jobs a chart can do
Before choosing a chart, say what the question is asking for. Almost every question about data is one of five jobs:
| Job | The question sounds like | Charts that do it |
|---|---|---|
| Comparison | Which is biggest? How do these rank? | bars, dots on a line |
| Distribution | How spread out is it? What's typical? | histogram, box plot |
| Relationship | Does one go with the other? | scatter plot |
| Composition | What is it made of? What share is each? | bars of shares, stacked bars, a pie for two or three parts |
| Change | How did it move over time? | line chart |
Sort these questions into their jobs. One of them does two jobs at once.
0 of 6 placed right
Which town had the most rain in February?
Do customers who visit more often spend more per visit?
What part of Lipa’s sales is rice, sugar and oil?
Has Rosario’s oil sales grown since last year?
How long do customers wait at the counter?
Did each store’s share of all sales go up or down from January to February?
Test your eyes
Here is the same kind of question six times: the biggest value is 100; how big is the pink one? Twice as bars, twice as a pie, twice as bubbles. Guess with the slider, then check. Nothing you answer leaves this page.
The biggest value, A, is 100. How big is C?
Most people are closest with the bars, further off with the pie, and furthest with the bubbles. If you were, you've just repeated a famous experiment.
Position beats angle beats area
In 1984 William Cleveland and Robert McGill asked people to judge sizes drawn in different ways, and measured how wrong they were. The ranking they found, best first, has been found again many times since, including by Jeffrey Heer and Michael Bostock in 2010 with hundreds of people online:
- Position along a common scale: dots or bar ends against one axis.
- Position along scales that aren't lined up: the same, in separate panels.
- Length: bars that don't share a baseline.
- Angle and slope: pie slices, the steepness of lines.
- Area: bubbles, squares.
- Volume, and colour shade: 3-D shapes, how dark a colour is.
So: show the numbers that matter most as positions. Use area and colour for things that only need to be roughly right. Here is the same data both ways, each store's share of all kilos sold. Run it.
In the pie, can you tell whether Lipa (25.6%) or Tanauan (22.4%) is bigger, and by how much? In the bars, the answer is obvious and so is the order. A pie can only say "about a third" or "about a quarter", and only when there are two or three slices. That's sometimes all a reader needs, but rarely.
Wrong way: a pie with twelve slices
A bigger store's sales split into twelve product lines. The shares add up to 100, which makes a pie feel right. Run the first two cells.
Try to answer from the pie: are canned fish and noodles the same? Which is bigger, sugar or bread? Where does "phone load" rank? The labels crowd together at the small end, the colours repeat (matplotlib has ten in its default cycle, so the eleventh and twelfth slices reuse the first two colours), and you're comparing twelve angles.
The third cell draws the same twelve numbers as sorted sideways bars. Every question above is now one glance: noodles (11) are just ahead of canned fish (10), bread and oil tie at 4, phone load is eighth. The check: if a pie has more than three slices, or the reader needs to compare slices that are close, use bars.
Check what you learned
Sources
Every example on this page was run with Python 3.14, and its output and error messages are copied from it. These pages cover the same ground in more depth.
- Cleveland and McGill, Graphical Perception, Journal of the American Statistical Association 79(387), 1984: the experiments that ranked position, length, angle and area
- Heer and Bostock, Crowdsourcing Graphical Perception, CHI 2010: the same ranking found again, with many more people
- matplotlib: matplotlib.axes.Axes.pie: labels and wedge order
- matplotlib: Plot types: the charts to choose from