scale-radius
Linear-radius continuous size scale.
Alias of scale-size-continuous with the more explicit name. Provides the linear value-to-radius mapping that gribouille already uses by default; scale-size-area is the area-proportional variant.
Usage
scale-radius(
name: none,
range: (1pt, 6pt),
limits: none,
breaks: auto,
labels: auto,
)Parameters
| Parameter | Default | Description |
|---|---|---|
name |
none |
Legend title. Overrides any name set via labs when both are present. |
range |
(1pt, 6pt) |
Pair of Typst lengths (min, max) bounding the output radius. |
limits |
none |
Pair (lo, hi) clipping the trained domain, or none. |
breaks |
auto |
Array of break values for the legend, or auto. |
labels |
auto |
Array of legend labels aligned with breaks, or auto. |
Returns
Scale object consumed by plot.
Examples
Marker radius grows linearly with w.
#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(fill: rgb("#1f77b4")),),
scales: (scale-radius(range: (1pt, 8pt)),),
width: 10cm,
height: 6cm,
)