Lesson 5 of 20
Axes — start at zero, or go logarithmic?
mutation counts from 2 to 2,152
Here are the mutation counts of 407 lung adenocarcinoma samples. Real TCGA data.
fewest2
median223
mean336
most2,152
The largest is a thousand times the smallest. What happens if you put that on an ordinary axis?
On the left it is one spike against the wall. On the right a bell appears. Same data.
Python
Runs in your browser
An axis needs four decisions.
| Decision | Default | When to break it |
|---|---|---|
| Start at zero? | bars: always | points and lines need not |
| Linear or log | linear | log when values differ by multiples |
| Tick spacing | multiples of 1·2·5·10 | almost never |
| Matching ranges | identical across compared panels | if not, say so loudly |
That last row matters most. When four conditions sit side by side the way they do in Fig. 5D, differing y-ranges make every height comparison wrong.
The two right-hand panels have cut the tail off. The fact that some patients reach 55% has simply vanished.
Python
Runs in your browser
🤔 Check yourself
Why is gene expression usually plotted on a log2 scale?
Answer Expression moves multiplicatively. On a log scale a fold change becomes a distance, which is something eyes can compare. It is the same reason the x-axis of a volcano plot is log2FC.
🤔 Check yourself
Cell proportions for four conditions are drawn in four panels. What must you do?
Answer People compare adjacent panels by height. Different ranges make that comparison flatly wrong. It is the first rule of small multiples — see lesson 15.
🤔 Check yourself
When may a bar chart's y-axis start somewhere other than zero?
Answer A bar rests on the promise that length is value. Better to change the mark than to break the promise. A dot plot is read by position and has no obligation to include zero.