scale-stepsn
Binned N-colour gradient colour/fill scale (stepsn).
Usage
scale-stepsn(
..args,
)Parameters
| Parameter | Default | Description |
|---|---|---|
..args |
Named arguments forwarded to the colour/fill scale (e.g. colours, n-breaks, breaks, name, limits, labels). |
Returns
Deferred scale spec consumed by scales.
Examples
Bin a numeric fill into N-colour stepped 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-stepsn(
colours: (rgb("#000000"), rgb("#888888"), rgb("#ffffff")),
n-breaks: 4,
)),
width: 10cm,
height: 6cm,
)