# Why use colormap viridis over jet?

As announced in https://www.youtube.com/watch?v=xAoljeRJ3lU, Matplotlib changes the default colormap from jet to viridis.

However, I don't understand it pretty well. Maybe because I'm color blind?

The original colormap jet looks very strong, I can feel the contrast:

While the new colormap viridis lacks that contrast:

Can anyone please explain it simpler for me? I need the plot for my paper. And I need a good reason to convince my supervisor (and myself) that the viridis is a better one.

• Note that Matlab has recently switched from jet to parula (as discussed in the linked video). – amoeba Jul 12 '16 at 13:48
• +1 to @amoeba comment. Since R2014b MATLAB uses the parula colour-map. One of the main reasons was that jet was rather uninformative for colour-blind male users and switching to parula was motivated by this. Male colour-blindness is commonly about 7-8% in quite a few north-European populations. – usεr11852 Jul 12 '16 at 16:35
• Use magma, plasma or inferno then... you are not forced to use the default, and IMHO the other three are "stronger". Viridis was chosen as default because "default must have green". If you want then in MATLAB you can get them here. Disclaimer: the FEX submission is mine. – Ander Biguri Jul 15 '16 at 13:04
• We also built a tool that helps you to analyze the different colormaps w.r.t. perceptual uniformity, linearity of grayscale mapping, and suitability for color-blind viewers. See bids.github.io/colormap and github.com/matplotlib/viscm We have a branch in development for designing bi-directional colormaps. – Stefan van der Walt Oct 7 '16 at 18:27

See this video. You could also google it because there are a lot of (reasonable) jet-bashing everywhere.

Jet is very pleasing because it is flashy, colorful, and it does not require you to think about your color scale: even if you have just a few outliers, you still get "all the features" in your plot. You said it yourself: jet almost never lacks contrast.

However this comes at a very high price: jet literally shows things that do not exist. It creates contrast out of nowhere: just change your color scale a little bit in jet and you should see that the picture is change dramatically. Do the same thing in viridis, and you would merely have the impression that you are putting more or less light on the exact same thing.

If you don't like viridis, use the other colormaps that were discussed in the video above: they have the same nice properties, and they won't make your data lie. Also change the color scale: starting at 0, even if it is logical from a scientific point of view, may not be a good idea to represent these specific data (but change your colorbar to reflect that, e.g. "<25").

But again, see the video, there are a lot of examples in there as well as complete explanations.

• Got it, you actually link back the video I posted. I watch it again. And when at start, it gives the example of Mona Lisa. I suddenly get it. jet high light the contrast that does not exist, e.g. the forehead of Mona Lisa. – cqcn1991 Jul 12 '16 at 12:02
• Yes, exactly: typically jet over-emphasizes yellow and cyan. Depending on your color scale, you will "see" different things. In veridis-like colormaps, if you don't see something you used to see in jet then it means that the the thing you are looking for is negligible compared to the rest: this is the whole purpose of a colormap, to give our brain an estimate of the relative significance of each pixel. :) (and yes, you cited the video, but it really contains good examples and I was wondering I you already saw it or just cited it to present veridis) – JohnW Jul 12 '16 at 12:10
• And there have been examples of papers chasing explanations of weird effects that were just artefacts of jet. I'll try to dig some. – Davidmh Jul 12 '16 at 19:48
• I also have to add that the performance of virdis varies according to differnt screens. I have an old laptop and a new desktop hackintosh. The desktop hackintosh's virdis looks much better and clearer than the laptop. – cqcn1991 Jul 13 '16 at 0:58
• So, there is this example. Unfortunately, the original reference is in the blog abandonmatlab, that is now private. All the blogs that I could find cite the blog, but not the paper. If anyone finds it, I will be very glad. – Davidmh Jul 13 '16 at 10:58

You need the plot because you need to show data and you need a colormap because you know that the color you show will not be seen equally by all persons: any color is an interpretation through our visual perception.

Indeed, colors are subjective in the sense that they are interpreted by the brain (in the sense that a spectrum is transformed into a neural activity) into different levels of valence (or value) as a function of the colorbar given next to it. Your eyes will make a constant set of saccades to match the plot with the bar.

JET is to be banned because it is perceptually ambiguous. One first feature of colors in visual perception is its value, that is the total brightness, that acts as the most direct feature. However, this value is non-monotonic in JET, such that ONE value in brightness may induce different values in perception. This is in particular true for the blueiash - yellowish tone (and that most of the time those that correspond to zero values) which artificially "pop up" from an image. Check such curves on :

Viridis (among other alternatives) is made to avoid that problem. You may read this full description for this choice, and how to adapt your colormap to the category of data to plot.

The issue with using any kind of color scale to visually represent ordinal data is that of luminance monotonicity: that is to say, if you have data that satisfy some kind of ordering relationship, that relationship should be reflected not just by changes in hue, but by luminance. The problem with the "jet" color mapping is that the highest point in the mapping (corresponding to larger values) is given a red color, the middle range is given a yellow-green color, and the lowest is blue--but if we look at the perceived "brightness" (i.e., luminance) of those colors, it is clear that this mapping is not monotone. The other color mapping in your question fixes this defect.

The reason for this property should be obvious, not the least of which is the fact that if such figures are reproduced in grayscale, interpretability is not lost.

There's several nice answers here already, but I think it's still pertinent to add another viewpoint, from the excellent paper

Good Colour Maps: How to Design Them. Peter Kovesi. arXiv:1509.03700 (2015). Software available here.

which lays out in a very clear fashion the principles of colour-map design, and provides a really nice tool to analyze them for perceptual uniformity:

This 'washboard' plot has a steady ramp from zero to one going left to right along the bottom, and the top of the plot has a sinusoidal modulation of uniform amplitude. For a properly-designed color map, all of the fringes at the top should show identical, or at least similar, contrast. However, when you put jet to the test, it is immediately obvious that this is not the case:

In other words, there are a ton of fringes, in the red and particularly the green stretches of jet, that get completely nuked out and become completely invisible, because the colour map simply does not have any contrast there. When you apply this to your data, the contrast in those regions will go the same way as the fringes. Similarly, the sharp contrasts along the bottom, on what should be a smooth linear scale, represent places where the map is introducing features that are not really present in the data.