scale-colour-gradient
Continuous two-stop colour gradient.
Linearly interpolates between low and high across the trained domain. Defaults to a blue ramp.
Usage
scale-colour-gradient(
..args,
)Parameters
| Parameter | Default | Description |
|---|---|---|
..args |
Returns
Scale object consumed by plot.
Examples
Default low-to-high blue 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-gradient(),),
width: 10cm,
height: 6cm,
)Custom two-stop ramp passing explicit low and high colours.
#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-gradient(
low: rgb("#fee5d9"),
high: rgb("#a50f15"),
),),
width: 10cm,
height: 6cm,
)See also
scale-colour-gradient2, scale-colour-gradientn, scale-fill-gradient.