scale-radius
Linear-radius continuous size scale.
Since 0.5.0.
The explicit-name alias for a linear value-to-radius size mapping. The area-proportional variant is scale-area.
Usage
scale-radius(
..args,
)Parameters
| Parameter | Default | Description |
|---|---|---|
..args |
Named arguments forwarded to the size scale. |
Keys accepted by ..args:
name: Axis or legend title, as a string or content;none(default) falls back to the mapped column name.range: Marker-radius(lo, hi)length pair; default(1pt, 6pt).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.breaks: Array of tick positions in data units, a bare number for a single tick, a function of the trained values returning positions (thebreaks-*helpers return such a function), orauto(default) for computed breaks.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
Scale marker radius linearly with the value.
#let d = range(1, 8).map(i => (x: i, y: i, w: i))
#plot(
data: d,
mapping: aes(x: "x", y: "y", size: "w"),
layers: (geom-point(),),
scales: scales(size: scale-radius(range: (1pt, 8pt))),
width: 10cm,
height: 6cm,
)