Jet was a ubiquitous colourmap that slowly fell out of fashion over the last five years. It was the default colourmap for Matlab and Matplotlib (and probably others) until 2015ish. The replacements, Parula and Viridis, respectively, get a lot of love. A quick Google search will present numerous blog posts and articles maligning Jet and promoting the use of these newer colourmaps. It’s an unpopular opinion but, especially now that they are common and overused, I dislike Parula and Viridis as much as I dislike Jet.
To the surprise of my former self, I sometimes find myself typing
cmap='jet'. I won’t publish a figure using Jet, but for interactive use and quick plots, it can come in handy. When the default colourmap is Parula or Viridis, I feel as if I’m limited to three different colours: blue, teal, and yellow. The colours in the centre of the colourmap are barely distinguishable. With Jet, I can at least discern several colours. Although this issue can be negated somewhat by discretising the colourmap, the result is still less attractive than it could be:
The primary criterion in developing Parula and Viridis was to ensure the default colourmaps are perceptually uniform. One way to interpret this is that it means that if the colourmap is converted to grayscale, it should be linear. Parula and Viridis certainly achieve that, albeit with a limited range between light and dark for Parula.
Another criterion for Parula and Viridis is that they be colourblind-friendly, as in there should be no possibility for red–green confusion. From what I’ve read, the colourmaps achieve this. (Though this question on Stats StackExchange from a colourblind user implies Jet’s contrast can outweigh Viridis’s benefits.)
The issue I have with these criteria is that they could be equally well satisfied by a simple grayscale colourmap. Of course, a piece of software that defaults to grayscale would be a hard sell in the 21st century. (But there is some merit in the idea, if only because it would more likely force users to forgo the default and think about what to use instead.)
Ok, so no grayscale default. But what about a monochromatic colourmap? It’s just like grayscale, but with a touch of colour and more aesthetically pleasing:
I’m starting to contradict myself. I’m promoting monochromatic colourmaps, yet earlier I was complaining about the lack of distinction in Parula and Viridis. This hypocrisy alludes to the challenges of creating colourmaps. It’s part art, part science. And it raises the question of how much, as scientists, we need to know about colourmaps.
Scientists don’t need to reinvent the wheel when it comes to colourmaps. We shouldn’t have to think about all the low-level details about their construction like bezier interpolations or lightness corrections. That would be like a fisherman knowing how to manufacture a fishing rod. Such details are irrelevant to catching a fish. But the fisherman does need to know the right equipment to buy. Similarly, scientists should have a working understanding of (i) colour-mapping tools available, (ii) what is meant by sequential, diverging, and qualitative colourmaps (iii) how to manipulate existing colourmaps, and (iv) what colour combinations readers generally appreciate.
As colour figures started to become commonplace in the 90s, tools were developed by visualisation experts to simplify the use of colourmaps for everyone else. A well-known tool is ColorBrewer, developed by Cynthia Brewer (whose surname lends itself perfectly to the tool) and others. As the developers of ColorBrewer note, it is designed for those who want to present their data well, but for whom professional demands leave little time for learning how to specify colour. I’ve been using ColorBrewer sporadically for many years now, but only recently did I read the scientific papers charting its development.
The first thing you realise while reading Brewer et al. (1997, 2004) is how much thought actually goes into creating a colourmap. It’s far from an automatic process. Sometimes the first hurdle is simply naming the colours to be used. In the 1997 paper, for example, they necessarily begin by selecting hues that avoid naming confusions. People will agree that red is red and blue is blue. But one person’s lime may be another person’s yellow–green. And as for brown, if you’ve ever mixed several paints, you know how ambiguous the name ‘brown’ is.
Once colours are suitably defined, the next hurdle is just as subjective: picking colour combinations that people find aesthetically pleasing. The 1997 paper lists 10 hues in order of preference among a test audience. Blue and purple–blue top the list, whereas orange and yellow lie at the bottom. Although red is also in the bottom half, a multi-hued scheme involving yellow and red tested favourably. If that’s not subjective enough, throw in the complication that the colour schemes people found pleasing changed depending on the amount of clustering in the map they were looking at.
In spite of the limitations imposed by possible colour naming confusion and the subjectivity of what is aesthetically pleasing, ColorBrewer develops numerous attractive, perceptually uniform, and easily distinguished colourmaps. (Well, at least most are attractive; maybe not the scheme where one side is pink and the other is yellow–green.) The schemes are divided into three types: diverging, sequential, and qualitative.
As an aside, ColorBrewer also effectively contains attractive variants of Parula and Jet. In fact, to the surprise of ColorBrewer’s developers, the spectral scheme not only rated well for pleasantness with their test audience, but was also effective when used in a map-reading task.
Sequential colourmaps come in two varieties: the monochromatic schemes I mentioned earlier and multihued schemes. Example of the latter include purple-to-blue or the Yellow-to-Orange-to-Brown shown in a figure above. Such schemes are usually my go-to choices. The variation in hues provides more contrast, making different parts of the colourmap easier to differentiate. That said, monochromatic schemes still serve a purpose.
When multiple colourmaps are needed for a single figure, monochromatic schemes are often the best choice. They are similar yet distinct and many options are available. Conversely, imagine that you need two colourmaps for a figure and you first choose Parula or Viridis. What would you pick as the second colourmap? It would be easy to pick something distinct, but it would be challenging to pick something that pairs nicely.
In a paper
I’m currently preparing now published, I need to display the ocean’s near-surface temperature structure on three different days together with the respective gradients for each. This requires 3 × 2 = 6 different colourmaps. (The ranges differ between the three days, so I can’t use the same colourmap twice.) However, I want it to be clear that among the six panels, there are only two quantities: temperature and temperature gradient. To achieve this, I use hot colours (reds and oranges) for the temperature and cool colours (blues and greens) for the temperature gradient:
Brewer et al. (2004) note that their catalog of schemes should be used flexibly. Part of a scheme may be omitted, and schemes may be combined to build customized schemes. This is what I did in the figure above. Although ColorBrewer has three hot monochromatic colourmaps (simply named Reds, Purples, and Oranges), it has only two cool ones (Blues and Greens). Consequently, I created a third cool map by averaging the Blues and Greens. (And for good measure I actually did the same with Reds and Oranges, rather than using Purples).
Only so much manual adjustment of colourmaps is feasible. For example, I altered the three hot colourmaps in the figure above to increase the darkness level on the right-hand side so as to introduce a little more contrast. I expected this to be a reasonably straightforward process, especially in hsl colourspace. Instead, it required a lot of trial and error and I’m still not sure that the end result looks quite right. But further trial and error is likely beyond the point of diminishing returns. Even the ColorBrewer developers ran into a similar type of problem. When taking the time to perfect a colour scheme, they sometimes ended up with a result inferior to the initial draft design based on how their test audience scored on map-reading tasks.
Ultimately, what’s considered a good or appropriate colourmaps is always going to be somewhat subjective. But a little thought, or at least some trial and error, will go a long way to improving the final figure. Indeed, consider default colourmaps to be like Swiss Army Knives. They may suffice in many situations, but they’re seldom the best tool for a particular job. Instead, get to know what existing colourmaps are available. Or, if your feeling particularly creative, try developing your own. But this can be tricky, so I recommend this interactive tool that deals with lots of little colour-related issues so that you don’t have to.
8 thoughts on “Default colormaps: Are Parula and Viridis really an improvement over Jet?”
Thanks, I’ve never actually seen a discussion on this. I use CAD a lot and usually put these together manually, can be quite tedious.
Your stack exchange link about jet and color-blind friendliness seems to be a non-color-blind person asking for an explanation and a bunch of people responding about why jet is bad. I skimmed quickly, so correct me if I am wrong
In the second sentence in the body text of the question, the person posing the question mentions they’re colour blind. That’s what I’m basing my statement off
Thanks for this write-up, Ken! I agree with your conclusions. Colormaps really are about accurately and intuitively conveying the underlying data while avoiding misinterpretation. I’m curious whether you have seen Kristen Thyng’s ocean colormaps (they’re gorgeous, and perceptually uniform!). I think there’s a lot to be said for customizing a colormap for a particular application (although, as you say, that’s not a trivial operation without the right tools); for example, the team that produced the rendering of a black hole designed a beautiful and very suitable colormap for their purpose. As part of the viridis/magma/plasma work we built the viscm tool that is now part of matplotlib and that allows others to design their own perceptually uniform colormaps in the CAM02-UCS color space. We hope that this and other similar tools mentioned are a first step towards empowering scientists to engage with their data representation in the ways suggested.
I had come across Kristen’s cmocean colormaps, but never looked too deeply into them. And I’m glad there’s people like you developing the tools that make picking a well-designed colormap easy.
I am not really understanding your objections to viridis/parula? Is it primarily aesthetic? Or is it the ‘mainstream’ aspect they have garnered by being defaults?
My understanding is that a monochromatic scale excels in intuitively representing trueness of form but is not only ugly , whereas a rainbow scale (e.g. JET), excels at a metric interpretation, giving a high dynamic range (many gradations). Indeed, a colormap that just follows the spectral locus would be pretty ideal when it comes to increasing dynamic range, but terrible at representing that intuitive form.
As I see it, Viridis (which I find vastly superior to Parula, besides all of my experience being in Matlab) is the compromise of these two extremes (grayscale vs. rainbow). Sometimes your data doesn’t need to represent form, and sometimes it doesn’t need to be indexable to the legend, in which case you can optimize by using one of the extremes. For most data, viridis definitely covers all the bases.
As a colorblind guy (protanopia), I definitely got defensive of JET when I started seeing jet bashing 10 years ago. I totally empathize with the guy in that stackexchange thread. Nobody can deny that it has great contrast, even for us colorblind users, and all of the proposed replacements felt like plainly worse alternatives. Some of them weren’t even monotonic to us (red-green CVD types), which is an advantage JET has (and most others of course).
I used JET for all of my vibration analysis for a decade, but upon researching its flaws, I’ve seen how all of those flaws have negatively affected my interpretation of spectrograms. Simply put, the advantages of Viridis are important – yet hidden – while the advantages of Jet really just slap you in the face.
I guess my underlying objection relates to the end of your first paragraph: “Sometimes your data doesn’t …, and sometimes it doesn’t … For most data, Viridis/Parula definitely covers all bases.” Which makes Viridis/Parula a Swiss Army knife as I noted in the post. In many cases, there’s a better colourmap for the job than the default. Another part of my objection, therefore, is that when I see these default colourmap, it implies that (possibly) no thought was given as to what the best colourmap would be for the given situation.
Thanks for the reply, I think I understand you better now. If I may paraphrase:
“that the use of defaults (whether it be viridis or jet) is usually not optimal and that by using these defaults, one signifies that they are not aware what would be the optimal colormap.”
Though clearly, for any plotting software, there needs to be a default colormap, and that a better default colormap is 80% optimal for 80% of applications, rather than 100% optimal for 20% of applications. This is why I still think Viridis is a far superior *default* than jet, and will be more optimum than jet for most applications, despite jet being more optimal than Viridis for *some* applications.
We have to expect that 95% of people who use a colormap will never get past the default, and that’s okay.
Also, here in Switzerland, the “Sackmesser” is *always* the ideal tool for the job 😉
Comments are closed.