Data visualizations using rainbow color scales are ubiquitous in many fields of science, depicting everything from ocean temperatures to brain activity to Martian topography. But cartographers have been arguing for decades the “Roy G. Biv” scale makes maps and other figures difficult to interpret, sometimes to the point of being misleading. And for the those with color blindness, they are completely unintelligible.

Now scientists at a U.S. Department of Energy laboratory have developed a color scale that is mathematically optimized to be accurate for both color blind people and those with normal vision. The scale was described Wednesday in a new study in PLOS ONE. “People like to use rainbow because it catches the eye,” says lead author Jamie Nuñez, a chemical and biological data analyst at the Pacific Northwest National Laboratory (PNNL). “But once the eye actually gets there and people are trying to figure out what’s actually going on inside of the image, that’s kind of where it falls apart.”

Ditching this multicolored scale may even save lives. Harvard University researchers found that when traditional rainbow-colored 3-D computer models of arteries were replaced by 2-D models using a red-to-black color scale (pdf), doctors’ accuracy in diagnosing heart disease jumped from 39 percent to 91 percent.

There are several reasons why the rainbow color scale is problematic. Perhaps the most fundamental issue is that the relationship among the colors is not intuitive. “The problem with the rainbow is that you don’t perceptually see it as ordered,” says Colin Ware, a human perception and data visualization expert at the University of New Hampshire who was not involved in the study. “If you give people the colors red, blue, green and yellow, they will not know which order to put them in.”

Another problem is the brain naturally interprets differences in brightness, or luminance, as representing depth, with the brightest colors at the peak. This is why gray scales are good for depicting topography (pdf) and shapes: People see the black as the lowest part of the scale, ranging through increasingly lighter grays with white at the peak. But among the colors of the rainbow, yellow has the highest luminance and will often appear to represent peaks on a map even though it is usually meant to be somewhere in the middle of the scale, with blue below it and red above. Nuñez and PNNL chemical engineer Ryan Renslow tackled this problem with their new scale, which they call cividis, by using just two colors with a clear brightness hierarchy: blue and yellow. Just as with a gray scale, people perceive the brightest yellows as peaks and the darkest blues as lows. But viewers can perceive a greater level of detail with colors instead of shades of gray.

An image of yeast cells is shown in gray scale (left), with a rainbow color scale (middle) and as a person with red-green color blindness sees the rainbow image (right). Credit: Nuñez JR, Anderton CR, Renslow RS (2018) Optimizing colormaps with consideration for color vision deficiency to enable accurate interpretation of scientific data. PLoS ONE 13(7): e0199239.

To create the new color scale, the scientists built a software tool based on a cutting-edge mathematical model of human vision. The tool takes an existing color scale, simulates what it looks like to people with red-green color blindness (the most common form, affecting 7 to 10 percent of men and a tiny fraction of women), and then adjusts it so that both color and brightness vary at a steady rate through the entire scale. This ensures the scale accurately represents the underlying data. “I think it’s got lots of very good properties,” says climate scientist Ed Hawkins of the University of Reading in England, who has been lobbying for scientists in his field and beyond to abandon the rainbow. Hawkins was not involved in developing the new scale.

By mathematically optimizing their scale to be perceptually consistent among people who are color blind and those with normal color vision, Nuñez and Renslow avoided another major pitfall of the rainbow color scheme: With cividis, the perceived change in hue and luminance matches the actual change in the data. But with the rainbow, people see the transitions between some colors as gradual and others as abrupt, which can make it seem like there are sharp boundaries in the data where none exist. This effect can even cause scientists to misinterpret their own data, Hawkins says. A particularly striking example is a 2006 study that identified boundaries between colors on a rainbow map of ozone data in the atmosphere as important “fronts.” But those boundaries disappeared when the data were replotted using a different color scale.

Awareness among scientists of the rainbow scale’s hazards is increasing, at least partly thanks to the pleas of cartographers and scientists like Hawkins. But scientific journals, conferences (pdf) and press releases are still littered with rainbows. “People love colorful maps,” says Kenneth Field, a cartographer at the mapping software company Esri and a vocal critic of the rainbow. Even though a map with just a single color that varies from light to dark to show increasing values would in many cases be far clearer and easier to read, some people may find it dull relative to its full-spectrum cousin, Field says.

Some scientists may prefer the rainbow because it can convey more details of their data. Humans can discern only about 30 different shades of gray but millions of different colors. But because the rainbow will perceptually distort those details, Field says, any benefit is likely outweighed by the downsides for most visualizations. “Rainbows cause more problems than they solve.”

Yet this has long been the default color scheme for much of the available data-visualization software, and scientists have grown used to it. Hawkins and other scientists have made some inroads with software companies, convincing some to switch their defaults to better color schemes. Nuñez and Renslow have successfully lobbied to have cividis added to the color-scale libraries of about a dozen software packages. And they have created an open-source software tool that can help scientists create their own optimized color scales for their particular data sets and visualization needs.

Hawkins is hopeful more scientists will start making informed decisions about which color scale to use, but he thinks it may take some nudging to precipitate real change. “There may be a role at some level for the scientific journals to step in and say they will not take papers which use rainbow color scales.”

In the meantime, with climate change and extreme weather increasingly in the news, it is unlikely people will escape the rainbow map.