Main menu

The Diverging Color Map Is the New Rainbow Color Map

I am not a visualization specialist, but I’m convinced that the often used rainbow color map is not well suited for scientific visualization. It might be attractive, but it is not effective. I’m quite sure that many of you won’t agree on the attractive part, but, given the popularity of the rainbow map, many people do seem to like it…

The Rainbow Color Map Is Bad

One of the main applications of scientific visualization of data is to map numbers to colors. Using the rainbow color map for that can cause several problems. Three important ones are the following.

Research indicates that people do not automatically put the colors of the rainbow map in the right order. This can lead to a completely wrong interpretation of the data.

The perceptual rate of change of the colors is not the same throughout the entire color range. For example, the green region is much broader than the yellow one. This can lead to confusion if data values with comparable rates of change are mapped to those regions.

People with the relatively common red–green color blindness (about 5% of the population) perceive some of the colors that are not even adjacent in the map as very close together.

Diverging Color Maps

Diverging color maps are designed to avoid the problems of the rainbow map as much as possible. Take for example the “cool-to-warm” map that is shown at the top of Figure 1. A natural usage of this map is the display of some property that has a neutral value and some regions with both “lower” and “higher” values. Temperature would be a perfect, and obvious, example. The map has constant rate of change, which makes it much easier to map the colors back to numbers in your head. Additionally, it is interpreted correctly by people with red–green color blindness.

This image might not be a particularly good example, because it doesn’t have a neutral value that is somewhere in the middle. However, even then it reveals more detail in the originally very dark part of the image away from the center.

Python Code

Since I’m trying to combine promoting an interest in science with being useful, I’ve included a Python script below that creates the “cool-to-warm” map and then applies it to the Airy pattern. In practice, you’d create the .csv file only once, of course, but I wanted to keep everything together. The diverging_map module can be downloaded from the site of Kenneth Moreland.