Skip to content

VG-02 · VG · Data Visualization

Why the rainbow colormap lies

2,085 words · about 14 min listening

Read the Turkish original

Glance at the summary firstThe summary from the end of the lesson, as a road map before you start reading.
  1. In the rainbow colormap, lightness doesn't increase uniformly; both ends are dark and the middle is bright, so the color itself carries no "less to more" order.
  2. Sudden brightness jumps in yellow and cyan show boundaries that aren't in the data, while the wide green region hides real changes; in medical images, this can increase diagnostic errors.
  3. The grayscale test exposes this problem; for readers with color vision deficiency, too, the middle of the palette blurs together.

Short answer

The rainbow colormap shows numbers using the spectrum's colors from blue to red, but these colors' brightness doesn't increase uniformly: the yellow and cyan regions look much brighter than the other colors. The eye mistakes these brightness jumps for boundaries in the data; a smooth change looks stepped, and regions that have nothing to do with the numbers stand out. When the palette is converted to grayscale, the brightness order doesn't match the order of the numbers, and the map loses its meaning.

What does a colormap do?

A temperature map, an earthquake-wave simulation, or a medical image is a data surface where every point carries a number. To show these numbers, each value is assigned a color; this mapping is called a colormap. What's expected of the reader is to look at the color and judge whether the number is small or large, and how different it is from neighboring points.

This task has two conditions. The first is order: the colors themselves must give a sense of sequence, so the reader can guess which color means "more." The second is equal steps: an equal change in the data must correspond to an equally sized, perceived change in color. Which palette family to choose based on the type of variable is the subject of VG-01; here we look at a single family — the sequential palette used for showing numeric ranges — at its most popular but most problematic member.

Brightness doesn't increase uniformly

The rainbow colormap was used for years in scientific software as the default palette under the name "jet." It starts at dark blue, passes through cyan, green, yellow, and orange, and ends at dark red. On paper it seems logical: the spectrum is itself a sequence, and wavelength increases uniformly.

The problem is that the eye doesn't see these colors at the same brightness. Of the three dimensions DT-01 distinguishes, lightness is the most decisive one in colormaps, because our visual system reads shape, edges, and detail mostly from differences in lightness. The yellow and cyan in the middle of the rainbow look much lighter than the dark blue and dark red at the two ends. So the palette's lightness curve isn't a straight slope; it's a hill that rises in the middle and falls toward both ends, and is uneven all along the way.

Both ends are dark. So the lowest and highest values look close to each other in lightness, even though the difference between them is the entire range of the data. The reader can only learn which one is "more" by looking at the legend. The color itself carries no order.

False bands in yellow and cyan

Lightness not increasing uniformly creates a second problem. Along the palette, color changes very fast in some regions and almost not at all in others. Green covers a wide range as if it were a single color, while yellow and cyan make a sharp brightness jump within a narrow range. The eye sees these jumps as lines.

The result is boundaries that aren't in the data itself. A smooth, slowly increasing surface, when drawn with the rainbow colormap, looks like bands of color separated from each other by sharp lines. The reader might mistake these lines for an important threshold, a front, or a turning point. Other changes, just as important, can get lost inside the wide green region.

The grayscale test

The simplest way to see a palette's lightness order is to convert the image to grayscale. In grayscale, hue and saturation disappear; only lightness remains. A good sequential palette, once converted to gray, stays a smooth transition from dark to light, and the map is still readable.

When the rainbow colormap is converted to gray, the picture falls apart. The lowest and highest values turn into similar dark grays; the middle values become the lightest gray. The map turns into a pattern that's bright in the middle and dark at both edges. It's no longer possible to tell which region carries the highest value and which carries the lowest. This test is also a warning: a chart printed on a black-and-white printer, photocopied, or shown on a screen that emphasizes lightness doesn't show what the author saw.

Effects in scientific publications

The cost of the rainbow colormap isn't only aesthetic. In a study done at Harvard, 21 medical students, asked to find regions of low shear stress in coronary arteries — that is, regions carrying disease risk — viewed the same data with different colormaps. Those using a perceptually appropriate diverging palette found about 47 percent more risky regions in two-dimensional images, and about 82 percent more in three-dimensional images, than those using the rainbow colormap.

Findings like these, and years of criticism, eventually changed the software too. MATLAB switched its default palette from jet to parula in the R2014b release in 2014; Python's popular plotting library matplotlib made viridis its default in version 2.0. How these new palettes are designed is covered in VG-03.

Still, the rainbow hasn't disappeared from scientific publications. Earth scientists Fabio Crameri, Grace Shephard, and Philip Heron, in an article published in Nature Communications in 2020, wrote that rainbow-like and red–green palettes — which distort data with uneven color transitions and also exclude readers who have trouble telling colors apart — are still common in science, and called on the scientific community, publishers, and the press to move away from this practice.

A reader who can't tell red from green

In the middle of the rainbow colormap, red and green mark different points on the same scale. For a reader who has trouble telling red from green — the subject of BI-12 — these two regions can look very similar to each other; half the palette blurs together. This reader has trouble distinguishing high values from middle values, and false boundaries can form for them in different places.

A palette whose lightness increases uniformly also helps these readers, because the order information rests on lightness differences rather than hue differences, and lightness is affected far less by color vision deficiency.

Example — a heat map over a face photo

An interface team overlays an eye-tracking heat map — showing where users looked in an ad image — on top of the image with a translucent rainbow colormap. The image has the faces of three people with different skin tones.

On the light-skinned face, the yellow and orange band — which marks middle values, not the most-looked-at region — blends into the skin; on a face whose brightness is already high, the brightest color band goes unnoticed. On the dark-skinned face, the dark blue and dark red ends, which mark the lowest and highest values, blend into the darkness of the skin; here too, the yellow band jumps out as if it were the most important region, even though the data doesn't say so. The same data tells three different stories on three faces.

A single-hue palette, or one whose lightness increases uniformly, used together with a frame or contour line that can be read independently of the face's own lightness, shows the same order on all three faces.

Common misconception

Common mistake"The rainbow colormap shows more detail because it uses more colors."
Correction

More hues doesn't mean more information; as long as lightness changes uniformly, even a palette with few hues shows more accurate detail. Some of the rainbow's "detail" comes from false boundaries.

Common mistake"As long as there's a legend, the choice of palette doesn't matter."
Correction

The reader doesn't read the map by comparing it point by point against the legend; they read it by looking at it as a whole. The eye sees false boundaries before it looks at the legend.

Summary

  1. In the rainbow colormap, lightness doesn't increase uniformly; both ends are dark and the middle is bright, so the color itself carries no "less to more" order.
  2. Sudden brightness jumps in yellow and cyan show boundaries that aren't in the data, while the wide green region hides real changes; in medical images, this can increase diagnostic errors.
  3. The grayscale test exposes this problem; for readers with color vision deficiency, too, the middle of the palette blurs together.

Test yourself

  1. (Easy) What is a colormap?
  2. (Easy) Which colors appear brightest in the rainbow colormap?
  3. (Medium) Why does the rainbow colormap become meaningless when converted to grayscale?
  4. (Medium) How does a false boundary form, and how can it mislead the reader?
  5. (Hard) How does the result of the coronary artery study show that palette choice isn't just an aesthetic preference?
  6. (Hard) Why does a palette whose lightness increases uniformly also help readers with color vision deficiency?

Answers

  1. A rule that maps numeric values in order to colors; the lowest value goes to the color at one end, the highest value to the color at the other end ("What does a colormap do?").
  2. Yellow and cyan; they look much lighter than the dark blue and dark red at the two ends ("Brightness doesn't increase uniformly").
  3. In grayscale, only lightness remains; in the rainbow, the two ends turn into similar dark grays and the middle becomes the lightest gray, so the lightness order doesn't match the order of the values, and it's no longer clear which region carries the highest value ("The grayscale test").
  4. When the palette has a sudden lightness jump within a narrow range, the eye sees it as a line; a smooth surface looks divided into sharp bands, and the reader may mistake these lines for an important threshold ("False bands in yellow and cyan").
  5. Medical students looking at the same data found about 47 percent more risky regions in two dimensions and about 82 percent more in three dimensions with a diverging palette than with the rainbow; the palette directly affected the accuracy of the diagnosis ("Effects in scientific publications").
  6. The order information rests on lightness differences rather than hue differences; lightness is affected far less by the color vision deficiency that confuses red and green ("A reader who can't tell red from green").

Sources

  • Borland, D., and Taylor, R. M., "Rainbow Color Map (Still) Considered Harmful," IEEE Computer Graphics and Applications 27(2): 14–17, 2007.
  • Borkin, M. A., et al., "Evaluation of Artery Visualizations for Heart Disease Diagnosis," IEEE Transactions on Visualization and Computer Graphics 17(12): 2479–2488, 2011.
  • Crameri, F., Shephard, G. E., and Heron, P. J., "The misuse of colour in science communication," Nature Communications 11: 5444, 2020.

Next step

VG-03 turns this lesson's diagnosis into a cure: it explains how perceptually uniform colormaps like the viridis family are designed, how a palette curve is drawn in a perceptually uniform color space, and which palettes are used for cyclical data. VG-07, meanwhile, extends the color vision deficiency problem to the whole chart: it shows how to avoid the red–green pair, how to use direct labeling instead of a legend, and how to distinguish categories with pattern and shape.

Animation and narration notes

Animation and narration notes

Video flow

  • 0:00–0:30 Hook: The card's visual idea — a smooth hill surface splits into stepped bands under the rainbow colormap.
  • 0:30–2:00 Story: The same surface turns gray; the peak and the two slopes look the same darkness, and the order disappears.
  • 2:00–6:00 Explanation: A lightness curve is drawn under the palette; it peaks at yellow and cyan and drops at the ends. The points where false boundaries appear are then marked.
  • 6:00–7:00 Aha moment: The same artery image side by side with two palettes; the risky regions are immediately visible with the diverging palette.
  • 7:00–8:30 Real world: An eye-tracking heat map over faces with three different skin tones; the yellow band falling on a different spot on each face.
  • 8:30–9:30 Myth correction: The sentence "More colors = more detail" is struck through.
  • 9:30–10:00 Closing: The grayscale test is done with a single button; the VG-03 and VG-07 codes.

Visual notes

  • Data surfaces and artery images are drawn with original synthetic data; no figure from a published article is copied.
  • The palettes' lightness curves are drawn from measured values; no eyeballed curve is used.
  • The faces in the heat map scene are original illustrations; the three faces' skin tones range from light to dark and sit in the same frame.