Skip to content
Start free

What does a box plot hide?

Turn your tick marks into boxes, watch the box finally pick out Zapopan's big tickets, and learn what it still hides.

Free course. Your Maestro, an AI, .

On the last page, the average bar said "95 pesos" for both La Espiga branches, and the tick marks showed that almost nobody at Zapopan spends 95. Drawing every ticket works with 240 tickets. With 24,000, the tick marks turn into a smear.

That's what the is for: it sums up each group in five numbers and keeps the values that stray far in plain sight. It's the next step after the average. And it has its own trap.

These five boxes are the same. What do you think the data under them looks like?

Five groups with the same minimum, quartiles and maximum.

Try it

This is your tick-mark chart from the last page. Change it so it draws one box per branch.

Your turn

Two changes (the columns are in Spanish: monto_mxn is the ticket amount in pesos, sucursal the branch). First the mark: in Altair, the box is called a boxplot. Then the axis title: it still measures every ticket, but now summed up. You're done when you see two boxes. Before you move on, find where Zapopan's 12 big tickets ended up. If you get stuck, ask your Maestro for a hint.

Data: tickets-sabado, 240 rows
The exercise's data, "tickets-sabado". Your edits run with your code.
RowRemove
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
Page 1 of 12

What the chart shows

Two rows of tick marks, one per branch: at Centro the tickets gather between about 50 and 150 pesos; at Zapopan almost all are under 80 and twelve sit alone between 400 and 600.

Centro's box runs from 84 to 106 pesos, with the median at 96. Three tickets show up as single dots: 44, 142 and 147.

Zapopan's box sits much lower: it runs from 46 to 66, with the median at 54.5, and the whiskers reach from 27 to 79. Then, far to the right, twelve single dots between 402 and 593. The average bar never said this: the box plot does set most of the big tickets apart.

BranchMin.Q1MedianQ3Max.Single dots
Centro4483.7596106.2514744, 142, 147
Zapopan2745.7554.56659312, from 402 to 593

Now the trap. The box draws those twelve tickets as "odd values", as if they were mistakes. But 12 out of 120 is one ticket in ten. They aren't odd: they're another kind of customer, maybe party orders, who need a different promotion.

Why doesn't Zapopan's box reach the big tickets? Ask your Maestro.

What a box doesn't tell you

A box keeps five numbers. You guess the rest, and the figure at the top showed how much can change under identical boxes. Before you trust a box, ask three questions:

  1. How many values are underneath?

    A box of five values looks just as solid as one of five thousand.

  2. Are the single dots mistakes or a group?

    Count them. If there are many, look at who they are.

  3. What shape do they have?

    Ask for the dots on top of the box, a violin or a histogram.

Two groups have identical boxes: the same median and the same quartiles. Does that prove their data has the same shape? Explain and say what you would look at.

Check yourself, 1 of 2: Two groups have identical boxes: the same median and the same quartiles. Does that prove their data has the same shape? Explain and say what you would look at.

Ctrl+Enter or ⌘+Enter sends it.

Answer it yourself

Check yourself, 2 of 2: In Zapopan's box plot, 12 of 120 tickets show up as single dots, all above 400 pesos. What should you do with them?

The rule for your charts: use the box to compare many groups quickly, and draw the dots on top when there are few of them or when the shape matters.

Ask your Maestro for a dataset with a misleading box so you can find what it hides.