Heatmap
A heatmap is a grid of colored cells. Use it for two categorical axes (e.g. day-of-week × hour-of-day), or for two binned numeric axes (use Plot.rect with binX/binY instead — see Histogram for the binning idea).
Categorical x and y
Section titled “Categorical x and y”```plot view=signups_by_day_hourPlot.cell(data, { x: "hour", y: "day", fill: "count", inset: 0.5 })```Calendar (month × day-of-week)
Section titled “Calendar (month × day-of-week)”```plot view=daily_signupsPlot.cell(data, { x: "week", y: "weekday", fill: "count" })```Common options
Section titled “Common options”| Option | Meaning |
|---|---|
x, y | column names (typically categorical / ordinal) |
fill | column name → cell color value |
inset | gap between cells in px |
r | column name → also vary cell radius (rare) |
| color scale (top-level) | { scheme: "blues" / "viridis" / "rdbu" / ... }; pair with legend: true |
tip | true for hover tooltips |
For binned numeric heatmaps (e.g. binned-x × binned-y), use Plot.rect(data, Plot.bin({ fill: "count" }, { x, y })).
See Observable Plot — cell for the full reference.