Mathwords logoMathwords

Heat Map — Definition & Example

A heat map is a chart that shows numbers as colors, so you can spot high and low values at a glance. Darker or "hotter" colors usually mean larger values.

A heat map is a display in which each cell of a two-dimensional grid, or each location on a map, is shaded according to a color scale. The scale is a rule that assigns each data value, or each interval of values, to one color. A legend states that rule. A matrix heat map has a categorical or numerical variable on each axis. A geographic or density heat map shades positions in space by how often events occur there.

Worked Example

Problem: A coffee shop counts customers in three time blocks over three days. Monday: 40 (morning), 25 (afternoon), 10 (evening). Tuesday: 35, 30, 15. Wednesday: 50, 20, 10. Build a heat map with 4 equal-width color bins and describe the pattern.
Step 1: Find the smallest and largest counts, 10 and 50. Divide the range into 4 equal bins.
bin width=50−104=10\text{bin width} = \frac{50 - 10}{4} = 10
Step 2: Set the legend: 10 to under 20 is pale yellow, 20 to under 30 is orange, 30 to under 40 is red, and 40 to 50 is dark red. Shade each cell of the grid by its bin. For example, 30 is red and 40 is dark red.
MornAftEveMon402510Tue353015Wed502010\begin{array}{c|ccc} & \text{Morn} & \text{Aft} & \text{Eve} \\ \hline \text{Mon} & 40 & 25 & 10 \\ \text{Tue} & 35 & 30 & 15 \\ \text{Wed} & 50 & 20 & 10 \end{array}
Step 3: Read the colors. The morning column is all red or dark red, and the evening column is all pale yellow. The column totals confirm what the colors show.
40+35+50=125,25+30+20=75,10+15+10=3540+35+50 = 125, \quad 25+30+20 = 75, \quad 10+15+10 = 35
Answer: Mornings are the busiest time (125 customers in total), and evenings are the slowest (35). Wednesday morning, at 50 customers, is the hottest cell.

Why It Matters

In data science, analysts use heat maps of correlation matrices to see which pairs of variables move together. Meteorologists shade maps by temperature in degrees Fahrenheit. Sports analysts shade a basketball court by shooting percentage to find a player's strongest spots.

Common Mistakes

Mistake: Reading an exact number from a cell's color.
Correction: A color usually stands for a range of values, not one value. In the example, 30 and 35 are both red. Check the legend, and use the underlying table when you need exact values.

Related Terms

  • Box Plot — Summarizes the spread of one variable, not a grid
  • Box-and-Whisker Plot — Shows a five-number summary along one axis
  • Stemplot — Keeps exact data values that heat map colors hide
  • Data Graph — Broader category of visual data displays that includes heat maps
  • Contingency Table — Grid of counts that a heat map can color
  • Correlation — Heat maps often display correlation values between variables as colors