Lesson 3 of 20

The kind of data decides half the chart for you

categorical · ordinal · count · proportion · time · coordinate

The kind of data decides half the chart for you
There is only one question to ask before choosing a chart — what kind of number is this column?

“Which graph should I use?” is usually the wrong question. Ask first: what kind is each column of my data? Fix that and the shortlist drops to three or four.

KindExample (in this paper)Charts available
Categorical (names)tumour types LUAD·LUSC·STAD / cell types T·B·NKbars · dot plot · colour
OrdinalTMB-L → TMB-H / stage I·II·IIIbars (in order) · box
Count616 mutations / a count of 802histogram · scatter
Proportion3.03% TIL infiltration / cell compositionbars · box · (pie)
Timeday 0·3·6·…·21 after implantationline · step
Coordinatecell position in tissue / UMAP locationscatter · density · map
Pick a dataset, then swap the chart. Mismatched pairs raise a warning.
Loading…
Only group is categorical; the rest are quantities. Writing down the kind of each column first makes the chart choice easy.
Python Runs in your browser

The same column can change kind depending on what you are asking. The paper's TMB is the clean example.

As a quantity
how many per Mb → histogram. You see how skewed the distribution is
As an order
TMB-L / TMB-H split at 10 → two bars. That is Fig. 1B of the paper

The paper did both. The right half of Fig. 1B is the quantity (a box plot), the left half is the ordering (proportion bars). Drawing one column twice is not waste, it is honesty — they did not hide the original distribution after drawing a threshold through it.

🤔 Check yourself
You want to show mean TIL infiltration for thirteen tumour types. What fits best?
🤔 Check yourself
Tumour volume is measured on days 0, 3, 6, 9, 12, 15, 18 and 21. What should the x-axis do?