HIYSL REFERENCE / FIELD NOTES

How to Create a Sequential Color Palette for a Heatmap

On this page
AI-generated illustration; not taken on location · Illustrative heatmap with a light-to-dark blue legend
AI-generated illustration; not taken on location · A conceptual heatmap uses a light-to-dark progression to represent ordered values.AI-generated illustration

To create a sequential heatmap palette, choose a light and a dark version of one color, arrange intermediate shades between them, and map the progression to your data from low to high. Then inspect the finished heatmap: neighboring levels should be distinguishable, and the legend should explain what each color means.

The key decision is what the colors represent. A sequential palette works for an ordered range where you want readers to follow a progression. Before choosing shades, identify the variable, its units and range, and decide whether a continuous scale or a few labeled levels will make the chart easier to read. The steps below take you from that decision to a final check of the labels and missing values.

Decide what the color scale represents

Start by writing a plain-language description of the value in each cell. For example, a heatmap might show the number of orders received on each day, with cells organized by week and day. Record the unit, the lowest and highest values you intend the scale to cover, and whether larger values should receive greater visual emphasis.

A sequential palette can use variations in a single color’s intensity to represent an ordered range of quantitative values. It can also be useful for ordered categories, provided the labels make their meaning clear. An ordinal scale has an order, but that order does not necessarily tell readers how large the differences between levels are. If your categories are “low,” “medium,” and “high,” avoid presenting the spacing between them as a measured numerical difference unless your data supports it.

Next, choose between a continuous scale and discrete levels. A continuous scale suits a range of numerical values when readers should see gradual changes. Discrete levels are useful when you want readers to identify named or numbered bands. In either case, decide how much detail the chart needs to convey.

Finally, ask whether a meaningful baseline deserves special emphasis. If the important distinction is whether values fall above or below a baseline, a diverging palette, with contrasting colors around a neutral midpoint, may communicate that relationship more clearly.

Choose the endpoints and direction

Pick one hue as the starting point, then select a light endpoint and a dark endpoint. Blue is one possible choice, but the useful choice is one that fits the surrounding chart and lets readers distinguish the ends of the scale.

Decide explicitly which end means less and which means more. A light-to-dark sequence can place low values at the light end and high values at the dark end. You can reverse that assignment if it better serves the message, but make the direction explicit in the legend and keep it consistent throughout the heatmap.

For a working example, imagine a chart of daily orders with a scale from 0 to 50 orders. You could assign a pale blue to the low end and a dark blue to the high end. This choice establishes a direction; the next step is to find intermediate colors that support it.

Place both endpoint swatches against the actual chart background before committing. If the lightest color is difficult to see against the background, adjust it or use a visible boundary around cells. If the darkest color makes an overlaid label difficult to read, consider a different label color or another way to present the value. Keep a record of both endpoint codes so you can reproduce your choices.

Build an ordered progression

Add intermediate shades between the two endpoints. Arrange them in data order and look for a consistent change in perceived lightness: each successive shade should appear lighter or darker than its neighbor in the direction you selected. A shade that suddenly looks lighter in the middle of a darkening sequence can interrupt the visual order, so adjust it and compare the sequence again.

Here is an illustrative five-level starting palette, ordered from low to high:

Level Color code Intended position
1 #EFF6FF Lightest; lowest values
2 #BFDBFE Light
3 #60A5FA Middle
4 #2563EB Dark
5 #1E3A8A Darkest; highest values

These codes are a starting point, not a guarantee that every level will be easy to distinguish in your chart. Background, cell size and labels can affect the result. Review the shades together and in the finished heatmap before using them.

You can choose colors manually or use an available palette tool to explore candidates. Check what your chosen tool accepts and provides, then record the resulting codes in order. For a continuous scale, identify the endpoints and any intermediate colors your charting method asks for. For discrete levels, keep one code for each level and label the list from lowest to highest.

Map colors to the data

With the colors in order, connect them to the values readers will see. Set the scale’s lower and upper limits, assign the low and high endpoints, and check that the legend follows the same direction. Include the variable name and units in or near the legend so readers do not have to infer what the colors measure.

For discrete levels, write down the boundaries before applying the colors. In the example of 0 to 50 orders, five equal-width bands could be defined as follows:

Orders Palette level
0 to less than 10 1
10 to less than 20 2
20 to less than 30 3
30 to less than 40 4
40 through 50 5

This example makes each boundary unambiguous: a value of 10 belongs in level 2, and 50 belongs in level 5. Your own boundaries should reflect the range and distinctions that matter for your data. Decide how to handle values outside the displayed range, and explain that choice if such values occur.

For continuous shading, label the ends of the legend and add intermediate values where they help readers interpret the range. Treat missing values separately from measured values: choose a distinct appearance and label it “No data” or another accurate description. Do not let an empty cell look like a low value unless it actually represents one.

Inspect neighboring levels in the heatmap

A palette can look orderly as a row of swatches yet be difficult to read in the chart. Apply it to the actual heatmap and compare neighboring levels where they appear next to one another. Look for pairs that merge visually, especially where the distinction matters to the reader’s task.

Check the chart in black and white or grayscale as well. The lightness progression should still support the intended order, and levels that need to be distinguished should remain recognizable. If a color-vision-deficiency simulation is available to you, use it as another view of the chart. These checks are opportunities to find confusing areas, so inspect the legend and the cells together.

If two adjacent levels are hard to tell apart, adjust the colors and review the full sequence again. You might spread the shades farther apart while retaining their ordered lightness, or use fewer discrete levels if the extra distinctions are not useful. When reducing levels, update the boundaries and legend so the colors still correspond to the stated ranges.

Also inspect the chart at the size and in the format readers are likely to use. Small cells or a dense grid may make a distinction harder to see than it appears in a large preview. Ask someone unfamiliar with the chart to identify a low cell, a high cell, and any missing value using the legend.

Check labels and communicate the scale

Finish by checking every piece of text against the color directly behind it. A label that is clear on a pale cell may be difficult to read on a dark one, and the reverse may also be true. If needed, change the text color, move the label, or provide the value in another readable form. Check legend text and any missing-data key as well as labels inside cells.

Give readers ways to understand the chart without relying on color alone. Government Analysis Function guidance recommends this approach for charts. Depending on the chart and its purpose, you might include cell values, clear row and column labels, a written description of the main pattern, or a table of the underlying values. Make sure these alternatives use the same units and categories as the heatmap.

Before sharing, walk through the chart as a new reader would. Can you tell what one cell measures? Does the legend show which end is low and which is high? Are discrete boundaries clear, and is missing data identified separately? If the scale is continuous, can readers interpret its endpoints and any labeled intermediate values?

Save the ordered color codes, range, boundaries and missing-value treatment with your chart notes. Those decisions make it easier to reproduce the palette and to keep related charts consistent when their scales are intended to be compared.

Sources