Heatmap
Color-coded matrix revealing patterns across two categorical dimensions.
Sales by Day & Time
Hourly patterns
View data (12 rows)
| Hour | Day | Sales |
|---|---|---|
| 9am | Mon | 12 |
| 12pm | Mon | 25 |
| 3pm | Mon | 18 |
| 9am | Tue | 15 |
| 12pm | Tue | 30 |
| 3pm | Tue | 22 |
| 9am | Wed | 10 |
| 12pm | Wed | 28 |
| 3pm | Wed | 20 |
| 9am | Thu | 18 |
| 12pm | Thu | 35 |
| 3pm | Thu | 24 |
Use a heatmap when…
- Cross-tabulation of two categories
- Finding patterns in matrices
- Correlation matrices
Avoid when…
- Continuous x/y data (use contour)
- Few cells (use table)
- When precision matters (color is imprecise)
Data it needs
| Property | Value |
|---|---|
| Min Rows | 4 |
| Min Columns | 3 |
| Column Types | stringstringnumber |
Visual anatomy
Guiding principles
- ColorPerceptually Uniform Colormaps
Use a colorblind-safe sequential palette such as viridis or ColorBrewer YlGnBu — never rainbow
- ContextAbove All Else, Show the Data
Render the numeric value inside each cell when space allows; the catalog example does this so readers don't need to estimate from luminance
Consider instead
Common mistakes
Using rainbow colormap
No legend for color scale
Too many cells to read
History
Used in biology since the 1950s for gene expression; term coined by software designer Cormac Kinney in 1991.
Accessibility notes
Use a perceptually uniform, colorblind-safe colormap (viridis, magma, or ColorBrewer YlGnBu). Render values directly in cells when space allows so the chart isn't color-only. Provide a sortable data table as fallback.
Related reading
Got data? Let's see what works.
Drop your CSV. You'll get a Heatmap plus four alternatives - ranked by which one actually fits your data best.