scale-viridis-c
Continuous viridis colour/fill scale.
Usage
scale-viridis-c(
..args,
)Parameters
| Parameter | Default | Description |
|---|---|---|
..args |
Named arguments forwarded to the colour/fill scale. |
Keys accepted by ..args:
option: Viridis variant:"viridis"(default),"magma","plasma","inferno", or"cividis".name: Axis or legend title, as a string or content;none(default) falls back to the mapped column name.limits: Domain as a(lo, hi)pair, where either side may beautoto train that side from the data;none(default) trains both sides.oob: Handling of rows outsidelimits:"drop"(default) removes them,"squish"clamps them to the nearest limit.breaks: Array of tick positions in data units, a bare number for a single tick, a function of the trained values returning positions (thebreaks-*helpers return such a function), orauto(default) for computed breaks.labels: Array of labels aligned with the breaks, a function of the break value returning a string or content (theformat-*helpers return such a function), orauto(default) to format each break.
Returns
Deferred scale spec consumed by scales.
Examples
Map a numeric column onto a continuous viridis fill.
#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-viridis-c(option: "magma")),
width: 10cm,
height: 6cm,
)