Tol (2021) offers carefully chosen schemes, ready for each type of data, with colors that are:
All the scales presented in Paul Tol’s technical note (issue 3.2, 2021-08-18) are implemented here, for use with base R graphics, ggplot2 or ggraph.
According to Paul Tol’s technical note, the bright, contrast, vibrant and muted color schemes are color-blind safe.
The light color scheme is reasonably distinct for both normal or color-blind vision and is intended to fill labelled cells.
The pale and dark schemes are not very distinct in either normal or color-blind vision and should be used as a text background or to highlight a cell in a table.
The qualitative color schemes must be used as given (no interpolation): colors are picked up to the maximum number of supported values. Refer to the original document for details about the recommended uses (see references).
Scheme | Max. colors |
---|---|
bright |
7 |
high contrast |
3 |
vibrant |
7 |
muted |
9 |
medium contrast |
3 |
pale |
6 |
dark |
6 |
light |
9 |
If more colors than defined are needed from a given scheme, the color coordinates are linearly interpolated to provide a continuous version of the scheme.
Scheme | Num. of colors | Bad data |
---|---|---|
sunset |
11 | #FFFFFF |
nightfall |
17 | #FFFFFF |
BuRd |
9 | #FFEE99 |
PRGn |
9 | #FFEE99 |
If more colors than defined are needed from a given scheme, the color coordinates are linearly interpolated to provide a continuous version of the scheme, with the exception of the discrete rainbow scheme (see below).
Scheme | Num. of colors | Bad data |
---|---|---|
YlOrBr |
9 | #888888 |
iridescent |
23 | #999999 |
incandescent |
11 | #888888 |
discrete rainbow |
23 | #777777 |
smooth rainbow |
34 | #666666 |
As a general rule, ordered data should not be represented using a rainbow scheme. There are three main arguments against such use (Tol 2021):
If such use cannot be avoided, Paul Tol’s technical note provides two color schemes that are reasonably clear in color-blind vision. To remain color-blind safe, these two schemes must comply with the following conditions:
discrete_rainbow <- color("discrete rainbow")
plot_scheme(discrete_rainbow(14), colours = TRUE, size = 0.7)
When using the smooth rainbow scheme:
Tol, P. 2021. “Colour Schemes.” Technical note SRON/EPS/TN/09-002 3.2. SRON. URL: https://personal.sron.nl/~pault/data/colourschemes.pdf.