Lesson 8 of 20

Four ways to show a distribution — histogram, box, violin, points

why Figs. 2B and 2D chose the violin

Four ways to show a distribution — histogram, box, violin, points
A single bar shows you a mean. What distribution stood behind it is something a different chart has to tell you.

TIL infiltration for 480 patients. Real TCGA lung adenocarcinoma data.

patients480
1st quartile2.60%
median5.67%
3rd quartile14.28%
max55.8%
mean9.90%

The mean is 1.7 times the median — the distribution has a long right tail. Write “mean 9.9%” on a single bar and all of that disappears.

The same 480 values drawn four ways. Compare what appears and what vanishes.
Loading…
Look only at the leftmost bar and every patient seems to sit near 10%. In fact some are at 0% and some at 55%.
Python Runs in your browser

What each of the four shows and hides:

ShowsHidesUse when
Bar + errorthe mean, one spreadshape · number of modes · outliersonly when n is very large
Histogramthe whole shapeindividual values · group comparisonexamining one group closely
Boxfive numbers · outliersbimodalitycomparing several groups
Violinshape + group comparisonexact countswhen every group has a large n
DDX54's two groups are slightly offset; CD8A's separate cleanly. Making the degree of overlap visible is what a violin is worth.
Python Runs in your browser
🤔 Check yourself
You have four conditions with n = 6 each. What is the most honest chart?
🤔 Check yourself
A distribution has mean 9.9% and median 5.7%. What follows?
🤔 Check yourself
What does a box plot miss?