Plots
A Plot block is a fenced markdown block whose body is an Observable Plot expression. PlotPress runs the named view, exposes the result as data, and renders the result of your expression.
Cheat sheet
Section titled “Cheat sheet”| Chart | Mark | Use it for | Page |
|---|---|---|---|
| Bar | Plot.barY / Plot.barX | counts, sums, comparisons across categories | Bar |
| Line | Plot.line | time series, monotone trends | Line |
| Area | Plot.areaY | stacked time series, cumulative volume | Area |
| Dot (scatter) | Plot.dot | two-dimensional relationships, outliers | Dot |
| Histogram | Plot.rectY + Plot.binX | distribution of a single numeric variable | Histogram |
| Heatmap | Plot.cell | dense 2D categorical or binned data | Heatmap |
| Box plot | Plot.boxY / Plot.boxX | distribution + outliers across categories | Box plot |
How a chart appears in markdown
Section titled “How a chart appears in markdown”```plot view=monthly_revenuePlot.barY(data, { x: "month", y: "revenue" })```Three things happen:
- PlotPress runs
monthly_revenueagainst the dashboard’s default connection. - The result rows become
datainside the block body. - The expression’s return value is rendered. If it’s a single mark, PlotPress wraps it in
Plot.plot({ marks: [...] }). To control margins, scales, color, etc., return a full plot config.
Defaults
Section titled “Defaults”Every chart inherits a small set of defaults so most blocks are one-liners:
| Default | Value | Override |
|---|---|---|
| Width | parent width | width: NUMBER in the config |
| Height | 240 px | height=NUMBER in the fence info, or height in the config |
| Margins | Plot’s own (varies by mark) | marginLeft, marginRight, etc. |
| Color scheme | Plot’s tableau10 | color: { scheme: "viridis" } |
| Grid | off | y: { grid: true }, x: { grid: true } |
Parameters
Section titled “Parameters”Plot’s full mark-option reference is at observablehq.com/plot. Every chart page below lists the most-used options — there are more, and the ones below are stable across Plot’s 0.6.x line.