scale-colour-distiller
Continuous ColorBrewer colour scale.
Looks up a Brewer palette by name and interpolates linearly across its stops as a continuous ramp. direction flips the palette: 1 keeps the canonical order, -1 reverses it.
Usage
scale-colour-distiller(
..args,
)Parameters
| Parameter | Default | Description |
|---|---|---|
..args |
Returns
Scale object consumed by plot.
Examples
Spectral palette interpolated as a continuous ramp.
#let d = range(0, 12).map(i => (x: i, y: i, z: i * 0.5))
#plot(
data: d,
mapping: aes(x: "x", y: "y", colour: "z"),
layers: (geom-point(size: 3pt),),
scales: (scale-colour-distiller(palette: "Spectral"),),
width: 10cm,
height: 6cm,
)Set direction: -1 to reverse the palette so high values map to the canonical low end.
#let d = range(0, 12).map(i => (x: i, y: i, z: i * 0.5))
#plot(
data: d,
mapping: aes(x: "x", y: "y", colour: "z"),
layers: (geom-point(size: 3pt),),
scales: (scale-colour-distiller(palette: "Blues", direction: -1),),
width: 10cm,
height: 6cm,
)See also
scale-fill-distiller, scale-colour-gradientn, scale-colour-brewer.