Heat Maps Explained: Definition, Types, and How to Read Them

โฑ๏ธ 9 min read ๐Ÿ“Š Visualization

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:

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.

Example heat map: website visits per hour by day and time of day A 4-row by 7-column grid shaded from pale blue (fewer than 200 visits) to dark blue (800 to 1,000 visits). Weekday cells are palest at 9AM and darkest at 6PM. Weekend cells are darkest at 3PM and lighter again by 6PM. Mon Tue Wed Thu Fri Sat Sun 9AM 12PM 3PM 6PM Mon 9AM: 150 visits Tue 9AM: 170 visits Wed 9AM: 160 visits Thu 9AM: 180 visits Fri 9AM: 140 visits Sat 9AM: 260 visits Sun 9AM: 230 visits Mon 12PM: 450 visits Tue 12PM: 480 visits Wed 12PM: 470 visits Thu 12PM: 490 visits Fri 12PM: 430 visits Sat 12PM: 640 visits Sun 12PM: 610 visits Mon 3PM: 660 visits Tue 3PM: 690 visits Wed 3PM: 680 visits Thu 3PM: 700 visits Fri 3PM: 650 visits Sat 3PM: 860 visits Sun 3PM: 830 visits Mon 6PM: 880 visits Tue 6PM: 910 visits Wed 6PM: 900 visits Thu 6PM: 920 visits Fri 6PM: 850 visits Sat 6PM: 520 visits Sun 6PM: 480 visits Visits per hour 0 200 400 600 800 1,000
Example data. A single-hue sequential scale with five equal bins: pale = few visits, dark = many. Weekday traffic peaks at 6PM, weekend traffic at 3PM.

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.

  1. Read the title and axes. Know what the rows, columns, and cell value are (count, percentage, average, correlation) and the units.
  2. 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.
  3. 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.
  4. 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.
  5. Check the exceptions. A single cell that breaks its row or column pattern is either the most interesting finding or a data error.
  6. 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.

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.

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.

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.

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.

โ† Back to Visualization Tips