scale-binned-area
Binned area-proportional size scale.
Usage
scale-binned-area(
..args,
)Parameters
| Parameter | Default | Description |
|---|---|---|
..args |
Named arguments forwarded to the size scale. |
Keys accepted by ..args:
n-breaks: Integer number of equal-width bins used whenbreaksisauto; default 4.breaks: Array of bin edges, a function of the trained values returning edges (thebreaks-*helpers return such a function), ticked at the bin midpoints and overridingn-breaks, orauto(default) to cutn-breaksequal-width bins.range: Marker-radius(lo, hi)length pair; default(1pt, 6pt).name: Axis or legend title, as a string or content;none(default) falls back to the mapped column name.limits: Domain as a(lo, hi)pair, where either side may beautoto train that side from the data;none(default) trains both sides.oob: Handling of rows outsidelimits:"drop"(default) removes them,"squish"clamps them to the nearest limit.labels: Array of labels aligned with the breaks, a function of the break value returning a string or content (theformat-*helpers return such a function), orauto(default) to format each break.
Returns
Deferred scale spec consumed by scales.
Examples
Bin an area-proportional size scale into discrete steps.
#let d = range(1, 8).map(i => (x: i, y: i, w: i * i))
#plot(
data: d,
mapping: aes(x: "x", y: "y", size: "w"),
layers: (geom-point(),),
scales: scales(size: scale-binned-area(n-breaks: 4, range: (1pt, 12pt))),
width: 10cm,
height: 6cm,
)