Natesh Pillai points us to this recent article, “The misuse of colour in science communication,” which begins:
The accurate representation of data is essential in science communication. However, colour maps that visually distort data through uneven colour gradients or are unreadable to those with colour-vision deficiency remain prevalent in science. These include, but are not limited to, rainbow-like and red–green colour maps.
Yes, rainbow color scheme is well known to be horrible, and there are some alternatives.
I sent this to Jessica Hullman to get her thoughts, and she wrote:
I’ve never been a big color perception person, but yes, that’s generally what’s been assumed and taught in visualization research. Though in the last few years there have been a few studies that looked at this, inspired in part by how many scientists refuse to give them up (maybe there’s some utility we just haven’t thought of yet?) and found reasons to think rainbow color maps are not as awful as previously thought.
I just last week saw this one presented at IEEE VIS, which varies the task (inference—specifically how well people can tell which visualizations were produced by the same model—rather than just perceiving data values through color), and finds: Contrary to conventional guidelines, participants were more accurate when viewing colormaps that cross a variety of uniquely nameable colors. I haven’t had time to read closely, but there was some discussion about whether the argument that crossing more nameable colors is helpful can really be made if they didn’t control for the number of discriminable steps (steps for which there is a just-noticeable difference) in the color ramp.
Another one suggests they’re not bad for judging differences in gradients of scalar fields.
Some other work finds that people are consistent in how they implicitly discretize rainbow scales, but also finds some data-specific differences in implicit discretization, concluding it’s more complicated than we thought to evaluate them.
While I’m still teaching students that they are generally a bad idea, I tell students this doesn’t mean there won’t be scientific applications where they do work ok. For instance, phase diagrams where you can look to see where all the colors meet (e.g., here). In general, there would seem to be few visualization guidelines that are always true.
The best uniform colorspaces right now are:
– Oklab (https://raphlinus.github.io/color/2021/01/18/oklab-critique.html)
– Viridis and the alternatives (https://cran.r-project.org/web/packages/viridis/vignettes/intro-to-viridis.html)
From the viridis link:
The “kinks” are what makes this palette the easiest to read. Why in the world are they trying to get rid of the kinks so 75% of the palette looks the same?
This explains a lot about why I can never read a heatmap anymore, it is like we are being purposefully targeted for exclusion.
This is a good talk on on the issues with rainbow color maps. There’s a lot to google on that for someone not caught up in confirmation bias.. https://www.youtube.com/watch?v=xAoljeRJ3lU
I don’t need to listen to a talk that tells me a hammer is going to fly up into the sky when I drop it.
I bet this was all arrived at by stringing together a bunch of NHST and never once testing the actual thing that matters.
I watched the video and two times he mentions studies where he dismisses what people actualy said was best. Instead he relies on some other outcome. He even says “don’t trust democracy”, as if everyone sees colors the same so the solution should be made for a hypothetical average color vision person for all situations that doesn’t exist.
The best I can do is channel Fisher:
https://www.york.ac.uk/depts/maths/histstat/fisher272.pdf
Given a color range, the presence of “kinks” necessarily means there are other areas (75%?) where the palette looks nearly the same.
I’m not a color expert, but the two available extremes seem to be discontinuous palettes (where the goal is to be able to discern the value from the color) and perceptually uniform palettes like viridis (where the goal is to be able to discern gradients). If your goal is one, you’ll hate the other.
According to what I was told, based on the color tests, I’ve got only 2 types of cones (missing green instead of red, green, blue), and the peak both are shifted a bit towards the center of the spectrum.
When I look at these heatmap “color blind” palettes I see roughly top 20%, bottom 20%, and middle 60%. That middle 60% is where most of the useful info is usually found.
Using the rainbow scheme. I can see five divisions. Roughly: 100-80, 80-60, 60-40, 40-20, and 20-0. Purple vs. red is an issue though (which is bad since theyre at opposite ends of the spectrum) so I drop purple/violet.
Deficiency? Just because I see colors different than you doesn’t make me “deficient” or “blind”. It is an advantage in some scenarios like seeing through camouflage.
Btw, for my particular color perception, rainbow pallet sans purple is by far the best. All of the supposed “color blind” pallets look washed out and unreadable. The important thing is bright, fully saturated colors. And not super tiny amounts, there needs to be some bulk to it.
It’s nice to have different options on this sorta thing that are easy to toggle.
One time my buddy had me make some plots where zero was white and then it was a different color gradient to either endpoint. That was neat cause you can see the zero transition exactly (it’s pinned to a very identifiable color).
In plotland, I came across plotnine recently (https://plotnine.readthedocs.io/en/stable/) which does the ggplot thing for Python and is super handy.
My understanding is that one of the few situations where the Sapir-Whorf hypothesis holds is that having more colors with distinct names aids in visual color differentiation. It seems plausible we could use this to make tasks easier by using named colors to highlight important distinctions. But it also seems like if you use it carelessly you will be introducing visual distinctions that are not a feature of the data and are distinctions you are trying to illuminate.
My guiding principle is don’t encode the data in color if I want readers to be able to precisely perceive gradations. Still hoping for the day when software developers set better defaults e.g. if I’m throwing 20 lines into the chart, maybe color code the first 5 lines and print all others as gray, instead of showing me 20 different colors, or 5 colors repeated 4 times.
> if I want readers to be able to precisely perceive gradations
Good principle, actually trying to read numbers out of a color scale is hard.
I tried writing a little script to help me explore colorspaces — conditional on one or more existing colors — a while back but couldn’t quite ever get it to work D:. Asked a question about it here, if anyone has insight on getting optimization algorithms to better traverse funky geometries: https://www.reddit.com/r/AskStatistics/comments/nlvbgz/what_optimization_algorithms_eg_as_implemeted_in/
Where I was working in grad school the go-to program for plotting data was IDL which, for whatever brilliance, had color 0 set to red and color 1 set to green. I could never read the graphs. Requests would be heeded for a time but…