scale-fill-stepsn
Binned n-stop fill gradient.
Fill counterpart of scale-colour-stepsn.
Usage
scale-fill-stepsn(
..args,
)Parameters
| Parameter | Default | Description |
|---|---|---|
..args |
Returns
Scale object consumed by plot.
Examples
Three-stop ramp discretised into six bins, shown as a swatch via geom-rect.
#let d = range(0, 16).map(i => (
xmin: i, xmax: i + 1, ymin: 0, ymax: 1, z: i,
))
#plot(
data: d,
mapping: aes(xmin: "xmin", xmax: "xmax", ymin: "ymin", ymax: "ymax", fill: "z"),
layers: (geom-rect(),),
scales: (scale-fill-stepsn(colours: (
rgb("#1a9850"), rgb("#ffffbf"), rgb("#d73027"),
), n-breaks: 6),),
guides: guides(fill: guide-none()),
width: 10cm,
height: 1cm,
)