scale-colour-viridis-b
Binned viridis colour scale.
Partitions the continuous domain into n-breaks equal segments, each coloured from the chosen viridis palette.
Usage
scale-colour-viridis-b(
..args,
)Parameters
| Parameter | Default | Description |
|---|---|---|
..args |
Returns
Scale object consumed by plot.
Examples
Four equal-width bins coloured from the default viridis 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-viridis-b(n-breaks: 4),),
width: 10cm,
height: 6cm,
)Bumping n-breaks and switching to the inferno option produces a finer-grained banded scale.
#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-viridis-b(option: "inferno", n-breaks: 8),),
width: 10cm,
height: 6cm,
)See also
scale-colour-viridis-c, scale-colour-viridis-d, scale-fill-viridis-b.