Skip to content
Graph Craft

Heatmap Matrix

FacebookX
Example: Service requests by day and time slot (made-up data)Apache ECharts

Variant: Standard

Made-up data, for demonstration only

Variants

5 types · click one to see it in the frame above
Difference from standard
The recommended type; use it as a starting point
Use when
Compare values in a two-dimensional grid using color

Heatmap is a table whose cells are coloured by value. This example shows the number of service requests (made-up data). The rows are 6 time slots and the columns are 7 days. The darker the cell, the more requests, so you see the overall pattern without reading 42 numbers.

How to read a Heatmap

  • Read the colour first. A dark cell is a high value. There must be a colour bar saying what each shade means.
  • Look for rows and columns that are dark all the way along. In this example the 10:00 slot is darker than the other slots on many weekdays (60 requests on Monday), while Saturday and Sunday are paler than the weekdays (12 requests at 10:00 on Sunday).
  • Look for cells that differ from their neighbours. A dark cell standing alone is an outlier worth checking.
  • Use numbers in the cells when you must read exact values. It is hard to convert a colour into an exact number, so write the numbers in the cells (see the "Numbers in cells" variant).
  • Check how rows and columns are ordered. If they have a natural order (days, hours) do not shuffle them. If they have none, sort by value so groups show (see the "Sort rows by total" variant).

When to use it

  • You want the overall pattern, not each cell's value. A heatmap helps you see the broad picture of numeric data, not pull out one particular value.
  • You have two categories and one value per pair, such as day × hour or product × month. It suits patterns between two categories but not fine differences.
  • The data is a large matrix that is too much to read as numbers. This is especially so when the rows and columns are arranged by clustering so that similar values sit close together.

When not to use it

  • You must compare small differences between cells. A heatmap is poor at showing fine differences. Use a Column Chart or a table.
  • Precise values are the main need. Use a Conditional Formatting Table.
  • The data is continuous dates across a whole year. Use a Calendar Heatmap.
  • Readers have red-green colour blindness. Choose a single-colour palette that runs from light to dark.

Common mistakes

1. No colour bar

Readers cannot tell what a dark shade stands for. Always include a colour bar or numbers.

BadRainbow colours

Synthetic data: colours clash although values change continuously

GoodSequential colours

Same data: light = few requests, dark = many; scale 0–70 requests

2. Using a rainbow palette

The palette matters a great deal. A rainbow hides the order of the values, and some bands look brighter without meaning anything. Try the "Rainbow colors" variant to compare.

3. Not rescaling before comparing columns with different units

You usually need to normalise the data first. Otherwise a column with large numbers drowns out the others.

4. Using a two-sided colour scheme on data with no meaningful midpoint

A diverging scheme suits data with a reference point, such as 0 or the mean. If there is none, use a single colour that runs from light to dark.

5. Ordering rows and columns without thinking about what the order means

In this example the days and times should keep calendar and clock order. Categories with no natural order can be reordered so that groups of similar values show.

Compared with similar charts

ChartHow it differsChoose it when
HeatmapColour stands for the value in a two-category tableYou want the overall pattern
Calendar HeatmapEach cell is a date on a calendarYou have daily data over several months
Correlation MatrixEach cell is the r value of a pair of variablesYou want to see the relationships of every pair
Conditional Formatting TableA table with numbers and colour togetherReaders also need the real values

History and development

Wilkinson and Friendly review the history of the cluster heat map. An early example they cite is Toussaint Loua's coloured table of 1873, which showed social statistics for the districts of Paris. Later came Jacques Bertin's idea in 1967 of a matrix whose rows and columns can be reordered, and the 1998 work of Eisen and colleagues, who used a cluster heat map in genetics. This history shows a path from hand-drawn colour tables to exploring the structure of data.

Frequently asked questions

How is a Heatmap different from a Correlation Matrix?

A correlation matrix is a kind of heatmap whose cells are the correlation between pairs of variables. An ordinary heatmap can show any kind of value.

Should I put numbers in the cells?

Yes, if readers need the exact values, because it is hard to convert a colour into an exact number.

How long have heatmaps been around?

See the history section above.

References

  • Heatmap · Data to Viz · www.data-to-viz.comUsed to confirm: how to read a heatmap and what to watch for
  • The History of the Cluster Heat Map · Wilkinson, L., & Friendly, M. (2009) · The American Statistician, 63(2), 179–184 · friendly.github.ioUsed to confirm: the history of the cluster heat map

Last updated 28 Nov 2026