scale-steps
Binned two-colour gradient colour/fill scale (steps).
Usage
scale-steps(
..args,
)Parameters
| Parameter | Default | Description |
|---|---|---|
..args |
Named arguments forwarded to the colour/fill scale (e.g. low, high, n-breaks, breaks, name, limits, labels). |
Returns
Deferred scale spec consumed by scales.
Examples
Bin a numeric fill into stepped gradient bands.
#let d = range(0, 12).map(i => (x: i, y: i, w: i + 1))
#plot(
data: d,
mapping: aes(x: "x", y: "y", fill: "w"),
layers: (geom-point(size: 5pt),),
scales: scales(fill: scale-steps(n-breaks: 5)),
width: 10cm,
height: 6cm,
)