Choose color scales by data meaning
Ordinal palettes separate ordered categories; sequential scales show magnitude; diverging scales show distance from a meaningful center.
What a color scale does
A color scale maps a data domain to a range of colors. Choose it from the meaning of the field, not from decoration: is the field unordered, ordered, quantitative, or a deviation from a meaningful reference?
Match the scheme to the data
| Data meaning | Suitable scheme | Example and caution |
|---|---|---|
| Unordered categories | Qualitative | Product or region; color separates labels, not rank or size. |
| Ordered categories | Ordered lightness or an ordinal scale | Low, medium, high; show order without implying equal numeric gaps. |
| Values increasing in one direction | Sequential | Sales or wait time; a lightness progression makes low-to-high order visible. A multihue ramp can look like separate clusters. |
| Values on both sides of a meaningful center | Diverging | Difference from target; use only when zero or another center is genuinely neutral. |
| Cyclic values | Cyclical | Time of day or direction; use for a wraparound pattern, not precise magnitude comparison. |
In Vega-Lite, ordinal is a scale type; sequential describes a palette for increasing magnitude. An ordered category can use an ordered palette, but its steps do not imply equal distances.
Work through an example
Suppose a fictional store report compares conversion with a 4% target. Plotting actual rate minus 4% gives −1 percentage point, 0, and +1 point. A diverging scale centered at zero shows below-target and above-target values. A separate chart of absolute rates such as 2%, 3%, 4%, and 5% should use a sequential scale. Unordered product groups should use a qualitative palette. These figures are illustrative.
Fix the domain and center
Use zero as a diverging center only when it means a real neutral point. For target differences, calculate the difference so zero means “on target.” If readers compare the absolute size of positive and negative deviations, use equal ranges on both sides; state an asymmetric range clearly. Keep the same domain across panels or periods being compared, or the same color may represent different values. Vega-Lite supports a continuous domain and a midpoint:
"color": {
"field": "variance",
"type": "quantitative",
"scale": {
"scheme": "redblue",
"domain": [-20, 20],
"domainMid": 0
}
}This is a partial encoding example, not a tested render. The midpoint must lie inside a continuous domain. Set domain and midpoint to the data's units and valid range, and define colors for missing or out-of-range values.
Make the chart readable without color alone
W3C guidance says color must not be the only visual cue for information or distinctions. Add text or symbols for status, vary line styles, or use patterns and direct labels. Check contrast, grayscale, and color-vision simulations, but do not treat contrast alone as a replacement for a second cue.
ColorBrewer’s palette picker offers a “colorblind safe” filter to narrow candidates. The filter does not certify the whole chart, so check the palette against the real background and category count, and retain other visual cues.
Verify the choice
Label the field as nominal, ordinal, continuous, deviation, or cyclic.
Decide whether readers need to distinguish groups, see order, compare magnitude, or read direction from a reference.
Set the palette, order, center, units, and domain; keep domains stable across comparable charts.
Inspect the legend and edge cases: missing values, extremes, and values outside the domain.
Check the chart at its real size and background. If meaning depends on color, add a visible label, symbol, line style, or pattern.