# Why you should dump the Rainbow

Recently, MATLABⓇ has changed the default colormap from ‘Jet’ to ‘Parula’.  On the surface, this may seem like a minor change, but I’d like to argue here why this an important change.  In short, Jet is a perceptually non-uniform colormap, creating and masking gradients in data.

# The Problem

Jet (also called Rainbow) colormap is based on spectrum of visible light.

It’s quite pretty to look at, right?  Jet being pretty is probably the reason it so frequently finds its way into plots and figures in presentations, papers and posters.  It draws the eye in quickly and is familiar.  Despite how bright this colormap is, it has a dark side.

I’ve drawn a few boxes, which are equally spaced on the spectrum.  Pay attention to the colors left and right side of each box.

Notice anything?  Let’s look at the color change from the left side of each box to the right side.

BOX 1: barely perceptible change

BOX 2: complete color change

BOX 3: barely perceptible change

BOX 4: complete color change

This example illustrates the main limitation for the jet colormap: it isn’t perceptually uniform.  When looking a figure or plot with a jet colormap, it is incredibly easy to be deceived into seeing gradients in the data that aren’t present, and even worse it is possible to miss gradients that are present.

# The solution: perceptually uniform colormaps

MATLABⓇ has now changed their default colormap to Parula.  This a perceptually uniform colormap and good change.

Color changes in this colormap are more uniform and doesn’t mislead the viewer into perceiving gradients in the data the aren’t present (or mask real gradients in the data).   There are a wide variety of perceptually uniform colormaps and you can find many that will suit your needs.

## Looking for more perceptually uniform colormaps?

I’d recommend Cynthia Brewer’s Colorbrewer version 2

MATLABⓇ scripts for Colorbrewer

Distinguishable linecolors for MATLABⓇ

## Want to read more?

How The Rainbow Color Map Misleads by Robert Kosara

Rainbow Color Map (Still) Considered Harmful by David Borland and Russell M. Taylor II (behind paywall)