scale-gradientn
N-colour continuous gradient colour/fill scale.
Interpolates through the colours array.
Usage
scale-gradientn(
..args,
)Parameters
| Parameter | Default | Description |
|---|---|---|
..args |
Named arguments forwarded to the colour/fill scale (e.g. colours, name, limits, breaks, labels). |
Returns
Deferred scale spec consumed by scales.
Examples
Interpolate a numeric fill through several colours.
#let d = range(1, 8).map(i => (x: i, y: i, w: i))
#plot(
data: d,
mapping: aes(x: "x", y: "y", fill: "w"),
layers: (geom-point(size: 5pt),),
scales: scales(fill: scale-gradientn(
colours: (rgb("#000000"), rgb("#888888"), rgb("#ffffff")),
)),
width: 10cm,
height: 6cm,
)