scale-colour-grey
Discrete grey colour scale.
Generates n evenly-spaced luma colours from start (darker) to end (lighter), each in [0, 1] where 0 is black and 1 is white.
Usage
scale-colour-grey(
..args,
)Parameters
| Parameter | Default | Description |
|---|---|---|
..args |
Returns
Scale object consumed by plot.
Examples
Default grey ramp from dark to light spread across three levels.
#let d = (
(x: 1, y: 2, sp: "a"),
(x: 2, y: 4, sp: "b"),
(x: 3, y: 3, sp: "c"),
)
#plot(
data: d,
mapping: aes(x: "x", y: "y", colour: "sp"),
layers: (geom-point(size: 3pt),),
scales: (scale-colour-grey(),),
width: 10cm,
height: 6cm,
)Narrowing start and end constrains the ramp to a darker range for tighter contrast.
#let d = (
(x: 1, y: 2, sp: "a"),
(x: 2, y: 4, sp: "b"),
(x: 3, y: 3, sp: "c"),
)
#plot(
data: d,
mapping: aes(x: "x", y: "y", colour: "sp"),
layers: (geom-point(size: 3pt),),
scales: (scale-colour-grey(start: 0.1, end: 0.5),),
width: 10cm,
height: 6cm,
)