scale-gradient2
Diverging three-colour gradient colour/fill scale.
Interpolates low-mid-high around midpoint.
Usage
scale-gradient2(
..args,
)Parameters
| Parameter | Default | Description |
|---|---|---|
..args |
Named arguments forwarded to the colour/fill scale (e.g. low, mid, high, midpoint, name, limits, breaks, labels). |
Returns
Deferred scale spec consumed by scales.
Examples
Diverge a signed numeric fill around zero.
#let d = range(0, 11).map(i => (x: i, y: i, w: i - 5))
#plot(
data: d,
mapping: aes(x: "x", y: "y", fill: "w"),
layers: (geom-point(size: 5pt),),
scales: scales(fill: scale-gradient2(midpoint: 0)),
width: 10cm,
height: 6cm,
)