Heat Maps Explained: Definition, Types, and How to Read Them
A heatmap is a grid where each cell is colored by its value, so patterns in a large matrix of numbers become visible at a glance. It shows where values are high or low across two dimensions - not exact numbers, but hot spots, cold spots, clusters, and outliers.
Quick answer: A data heat map encodes a number as color inside a grid: rows and columns are your two dimensions, and cell color shows the value at each intersection. The four main types are matrix heat maps (day ร hour traffic), correlation heat maps (variable ร variable, diverging scale), calendar heat maps (the GitHub contribution graph), and geographic heat maps (density over a map). Use a sequential color scale for low-to-high data and a diverging scale when there is a meaningful midpoint like zero.
What Is a Heat Map? Definition and Meaning
A heat map (also spelled heatmap; both are correct) is a data visualization that represents numeric values as colors on a two-dimensional layout, so you judge magnitude by shade instead of by reading digits. The name reflects the temperature metaphor behind the colors: hot colors such as red (or, on many single-hue scales, darker shades) usually mark high values, and cool colors such as blue (or, on those scales, lighter shades) usually mark low ones.
In practice, "heat map" means one of three things depending on who is talking:
- Data heat map (analytics, statistics): a grid of colored cells, like a spreadsheet where color replaces or backs each number. This is the heat map chart you build in Excel, Python, or Tableau, and the main focus of this page.
- Geographic heat map (mapping, GIS): smoothed color density drawn over a map to show where points concentrate, such as incidents or customer locations. It differs from a choropleth, which colors whole regions by value.
- Website heat map (UX, marketing): clicks, taps, or scroll depth overlaid on a screenshot of a page to show where visitors interact.
What Are the Main Types of Heat Map?
Four types cover almost every heat map you will see: matrix (two categories crossed, e.g. day of week ร hour), correlation (every variable against every other, colored -1 to +1), calendar (days arranged in a weeks ร weekdays grid), and geographic (density shading over a map). They share one grammar โ color encodes value โ but differ in layout and in which color scale is correct.
| Type | Layout | Typical use | Color scale |
|---|---|---|---|
| Matrix | Category ร category grid | Traffic by day ร hour, rep ร product sales | Sequential |
| Correlation | Variable ร variable, symmetric | First look at numeric datasets | Diverging (zero midpoint) |
| Calendar | Weeks ร weekdays | Daily activity, streaks, seasonality | Sequential |
| Geographic | Density blobs on a map | Crime/incident density, customer or store locations | Sequential |
To see each of these built with real data, browse these annotated heat map examples.
What Does a Heat Map Look Like, and What Does It Show?
A heat map looks like a table whose cells are filled with color: row labels run down the left, column labels run across the top, and a color bar or legend maps each shade to a value. It shows the intersection of two categorical or ordered dimensions (rows and columns) with a third quantitative value encoded as color, which answers questions like "which day-hour combinations get the most traffic?" faster than any table of numbers could.
How Do You Read a Heat Map?
Start with the title, axes, and legend so you know what each color means, then find the extremes, then look for rows, columns, or blocks that share a color. In data analysis, treat what you see as a lead to confirm against the underlying numbers, because color only gives you approximate values.
- Read the title and axes. Know what the rows, columns, and cell value are (count, percentage, average, correlation) and the units.
- Read the legend before the cells. Check which end is high, whether the scale is sequential (low to high) or diverging (two directions from a midpoint such as zero), and whether it is linear, log, or capped.
- Find the hot and cold spots. Using the legend, locate the cells at its high end and its low end. Often that means dark = high, but many defaults (viridis, seaborn's rocket) put dark at the low end. On most diverging scales (RdBu, coolwarm) the palest cells are the midpoint, not the minimum; a few, such as seaborn's icefire, use a dark midpoint instead.
- Look for bands and blocks. A whole row or column in one color means it is high or low everywhere, which often just reflects its overall size, so check whether the data is normalized. Blocks of similar color (square on a clustered correlation matrix, rectangular otherwise) in a clustered heat map mark groups of similar items.
- Check the exceptions. A single cell that breaks its row or column pattern is either the most interesting finding or a data error.
- Confirm with numbers. Verify key findings with cell annotations, tooltips, or the source table before you report them. In a heatmap table, where every colored cell also prints its number, read the exact value directly.
Applied to the traffic example above: the legend runs from pale blue (low) to dark blue (high), and the darkest cells sit at 6PM on weekdays and 3PM on weekends, so weekday traffic peaks in the evening, weekend traffic peaks mid-afternoon, and weekday 9AM is the quietest slot. On a correlation heat map, read sign and strength instead: one hue means positive, the other negative, deeper color means closer to +1 or -1, and the pale middle means near zero (no linear relationship).
When Should You Use a Heatmap?
Use a heatmap when you have matrix-shaped data (two dimensions crossed) with 50+ cells and the goal is spotting patterns rather than reading precise values. Below ~20 cells a table beats it; for one dimension, use a bar chart.
- Time patterns: day of week ร hour of day
- Correlations: variable ร variable relationships
- Performance grids: sales rep ร product category
- Survey results: question ร demographic group
Skip heatmaps for precise value reading (humans can't tell 47% from 49% by color), tiny datasets, single-dimension data, or unordered categories where no spatial pattern can emerge. Ready to build one? Follow the step-by-step guide to making a heatmap in Python and Excel, or jump straight to the Excel conditional-formatting heatmap walkthrough.
Heat Map Colors and Scale: Sequential or Diverging?
Use a sequential scale (light to dark, often a single hue) when data runs from low to high with no meaningful midpoint, and a diverging scale (two hues meeting at a neutral center) when there's a natural zero, average, or target. Typical heat map colors are light-to-dark blue (or viridis) for sequential data and red-white-blue (RdBu) for diverging data. Picking the wrong one is the most common heatmap mistake.
SEQUENTIAL (light blue -> dark blue):
- Sales volume, traffic, population density
- Light = low, dark = high
DIVERGING (red <- white -> blue):
- Profit/loss (zero midpoint)
- Correlation (-1 to +1, zero midpoint)
- Performance vs target (target midpoint)
- Temperature change (average midpoint)
Never use rainbow scales, and avoid red-green diverging pairs (about 8% of men can't distinguish them). Use 5-9 distinct steps, test the chart in grayscale, and label the legend with min/max and units. For picking specific ramps, see choosing color palettes.
Should You Normalize Heatmap Rows or Columns?
Normalize by row or column whenever one row or column has much larger raw values than the rest, because otherwise it dominates the color scale and flattens every other pattern into pale nothing. Convert each row (or column) to percentages, z-scores, or an index against its own mean, then color the normalized values.
Raw values: "Which cell is biggest overall?"
Row %: "How does each product distribute
across regions?"
Column %: "What is each region's product mix?"
Z-score: "Which cells are unusual for
their row?"
The same logic handles outliers: one extreme value can crush the rest of the scale. Fix it by capping colors at the 95th percentile, using a log scale, or marking outliers separately. In seaborn that's one argument: sns.heatmap(df, robust=True) โ more tricks in the Python seaborn heatmap guide.
What Is a Correlation Matrix Heatmap?
A correlation matrix heatmap colors every pairwise correlation between variables on a diverging scale from -1 to +1, making related variables jump out of what would otherwise be an unreadable grid of decimals. It's the standard first look at any dataset with many numeric columns.
Example: Stock correlations
AAPL MSFT GOOG AMZN
AAPL 1.0 0.8 0.7 0.6
MSFT 0.8 1.0 0.9 0.7
GOOG 0.7 0.9 1.0 0.8
AMZN 0.6 0.7 0.8 1.0
# Python one-liner:
sns.heatmap(df.corr(), cmap="RdBu_r",
vmin=-1, vmax=1, annot=True)
Always pin the scale to vmin=-1, vmax=1 with a neutral color at zero, and consider masking the redundant upper triangle since the matrix is symmetric.
What Is a Calendar Heatmap?
A calendar heatmap arranges days into a calendar grid (weeks ร weekdays) and colors each day by activity - the GitHub contribution graph is the famous example. It's the best format for spotting weekly rhythms, streaks, and seasonal patterns in daily data.
Layout: columns = weeks, rows = Mon-Sun
Color: commits, sales, workouts, sign-ups
Use cases: habit tracking, daily sales
patterns, support ticket volume, user
activity over a year
What Other Heatmap Types Exist?
Beyond the four main types, the other common variant is the cluster heatmap, where rows and columns are reordered by similarity so related items group together, standard in gene expression and customer segmentation work.
Heatmap Design Best Practices
Good heatmaps come down to meaningful ordering, readable cells, and honest legends; the color scale does the rest of the work.
- Order rows/columns meaningfully: chronological, natural (Mon-Sun), sorted by value, or clustered - never random or lazily alphabetical
- Cell size: at least 20ร20px so colors are distinguishable; aggregate before you reach a 100ร100 grid
- Labels: name both axes; rotate or abbreviate long labels; thin gray cell borders help separation
- Legend: min/max values with units, equal-sized bins (0-25, 25-50... not 0-10, 10-100)
- Missing data: show it distinctly (gray or hatched), not the same white as "low"
- Interactivity: hover tooltips with exact values cover the precision heatmaps lack; add zoom for large matrices
Common Heatmap Mistakes
Four failures account for most bad heatmaps: a sequential scale on diverging data, an outlier crushing the color range, too many cells to read, and unequal legend bins.
- Wrong scale type: sequential colors on profit/loss data hide which cells are negative - use diverging with zero as the midpoint
- Unhandled outliers: one huge value makes every other cell the same color - cap, log-scale, or normalize
- Too many cells: a 100ร100 grid is 10,000 unreadable dots - aggregate (hourly to daily) or show top N rows
- Inconsistent bins: ranges like 0-10, 10-25, 25-100 make equal color steps represent wildly unequal quantities
Heatmap Alternatives
If your audience needs exact values, has a small dataset, or only one dimension, another chart serves better than a heatmap.
| If You Need | Use Instead |
|---|---|
| Exact values | Table with conditional formatting |
| Small dataset (< 20 cells) | Bar chart or table |
| Single dimension | Bar chart or line chart |
| Geographic distribution by region | Choropleth map |
Quick Checklist Before Publishing
Run this list before shipping any heatmap; every item maps to one of the mistakes above.
- โ Color scale matches data type (sequential vs diverging)
- โ Legend includes min/max values and units, equal bins
- โ Both axes clearly labeled
- โ Cell ordering is meaningful (not random)
- โ Colorblind-safe palette used, works in grayscale
- โ Outliers handled; rows/columns normalized if scales differ
- โ Cell size large enough to distinguish colors
- โ Title explains what's being shown
- โ Missing data is indicated (not just white)
Golden Rule: Heat maps are for spotting patterns, not reading exact values. If your audience needs precise numbers, add tooltips or use a table instead. If the pattern doesn't jump out within 3 seconds, your color scale or ordering is wrong.