Using colour
Colour in data visualisation
In a chart or map, colour is a code. Use one hue for amounts, two for above and below, and distinct hues for categories.
Presented by ClearTrust Free for designers, students and the curious.
In a chart, colour carries information, so it has to be chosen for accuracy before appearance. Three kinds of colour scale cover nearly every case. A sequential scale, light to dark, shows amounts. A diverging scale, with two hues meeting at a neutral middle, shows values above and below a midpoint. A qualitative scale uses distinct hues for categories that have no order.
#440154Viridis 2#3B528BViridis 3#21918CViridis 4#5EC962Viridis 5#FDE725Diverging low#2166ACDiverging middle#F7F7F7Diverging high#B2182BMatch the scale to the data
For quantities such as rainfall or population, use one hue that runs from light for low to dark for high. Readers grasp that darker means more without a key. For data with a meaningful centre, such as temperature above and below average or votes swinging between two parties, use two hues that deepen away from a pale middle. For categories such as crops or languages, use hues that are clearly different but similar in strength, so that none looks more important. The American geographer Cynthia Brewer set out these types and published tested palettes as ColorBrewer.
The trouble with rainbows
A rainbow scale, running from blue through green and yellow to red, was for years the default in scientific software. It misleads. The eye sees sharp bands at yellow and cyan where the data change smoothly, lightness rises and falls along the way so order is unclear, and it fails for colour-blind readers. In 2015 the makers of a widely used Python plotting library designed viridis to replace their rainbow default. It runs from dark purple through green to yellow, is even in lightness and stays readable in greyscale. Many fields have since followed.
Restraint
The eye can keep about six to eight colours apart in a chart. Beyond that, group the small categories or label the items directly. Use grey for context and save strong colour for what the reader should notice. Keep meanings fixed, so that a party, a state or a product has the same colour on every chart. Be careful with colours that carry a judgement, such as red for bad. Check contrast against the background, and check the palette for colour blindness. A chart that still works printed in black and white has usually been coloured well.
How to do it
- Decide what the data are: amounts, values around a midpoint, or categories.
- Pick a sequential, diverging or qualitative scale to match.
- Limit categories to about seven colours. Group or label the rest.
- Use grey for background data and one strong colour for the main point.
- Test in greyscale and with a colour blindness simulator.
Sources and further reading
- Data and information visualization on Wikipedia
- ColorBrewer: Color Advice for Maps
- Crameri, Shephard and Heron, The misuse of colour in science communication, Nature Communications (2020)
- Datawrapper Academy: What to consider when choosing colors for data visualization
- Matplotlib: Choosing Colormaps
Original text by the Rang desk, written with AI assistance and checked against the sources above. Meanings of colour vary from place to place and person to person. If we have something wrong, tell us.