What your plotting library gives you by default
matplotlib's second and third colours are the same colour to a red-blind reader. Three conditions is the most ordinary figure there is.
You did not choose your colours. You plotted three conditions, your tool gave each one a colour, and you got on with the paper. That is the right thing to have done: the default is a decision somebody else already made, and the whole point of a default is that you should not have to think about it.
It is worth knowing what was decided.
The most ordinary figure there is
matplotlib’s shipped configuration sets its colour cycle to tab10, and
tab10 begins blue, orange, green. Draw three conditions and those are the
three you get. They are the same ten values as D3’s schemeCategory10, which
is what this page reads them from.
In ordinary vision the orange and the green are #ff7f0e and #2ca02c, and they are 28.6 apart on the OKLab scale this site screens its own palette with. Comfortable. Under simulated protanopia they are 0.7 apart.
The second and third default colours, and the same pair to a red-blind reader
Simulation after Machado, Oliveira and Fernandes (2009) at full severity. Series two and three of matplotlib's default cycle separate by 28.6 in ordinary vision and by 0.7 under protanopia, against the 9.5 floor this site holds its own six colours to. They are not close. They are the same colour.
What that does to a chart
Here are 342 penguins, three species, drawn the way a default draws them: one axis, colour carrying the grouping and nothing else carrying it. On the left as most readers see it. On the right as a protanopic reader does.
Reproduction. Reproduces matplotlib's first three default colours so the piece can show what they do, rather than redrawing them in a palette that would hide the problem. It is drawn to the original's rules, not ours, and our own checks refuse one thing in it.
As drawn
Reproduction. The same three default colours after protanopia simulation, which is the point of the figure and cannot be shown in this site's own palette. It is drawn to the original's rules, not ours, and our own checks refuse one thing in it.
To a protanopic reader
Three species, distinguished by colour alone
The same measurements twice, in matplotlib's first three default colours and in those same colours under simulated protanopia. On the right there are two colours, not three: the orange group and the green group have merged, and no amount of squinting separates them because there is nothing else to separate them by.
Roughly one man in twelve has some form of red-green deficiency, and protanopia is one of the two common kinds. On a paper with four reviewers and a few hundred readers, somebody in that chart’s audience is seeing two groups.
It is not only matplotlib, and it is not only other people
The useful question is not whether a palette is perfect but how far you can get before it stops working. Series are handed out in order, so what matters is how many you can draw before two of them collide.
How many series each default gets through
Series drawn before two of them fall below OKLab 9.5 under normal vision, protanopia, deuteranopia or tritanopia. Two of these tools survive four series. matplotlib does not survive three. The bar for this site is six, which is where it stops on principle rather than where it fails.
Observable Plot is on that chart because it draws every figure on this site. Its
default gets through four series, which is better than matplotlib and is still
not a palette anybody checked for this. We do not use it: everything here comes
from src/lib/palettes.ts, which was searched against exactly this test, and
the build refuses any colour that did not come from there.
There is a second problem in the same data that has nothing to do with colour vision. matplotlib’s orange is 2.45:1 against a white page. A mark needs 3:1 to be legible as a thin line, so that colour is already too faint for an error bar or a hairline before anybody’s colour vision is considered. Tableau’s default has three such colours in its first six. Observable Plot’s has five.
What to do
Nothing here requires you to design a palette. It requires you to stop accepting one.
- Set the colours explicitly, once, in whatever your lab plots with. Okabe and Ito’s set is the standard answer, it is free, and it is one line of configuration.
- Never let colour be the only difference between two series. Shape, dash or a direct label costs nothing and makes the question moot.
- If you must keep a default, keep it to two series. Every palette here survives two.
The pre-submission figure checklist has this on it, and the palettes page has ready-made hex lists and Fiji lookup tables if you would rather take one than pick one.