scale-fill-continuous
Continuous fill scale mapping a numeric column to fill colours.
Usage
scale-fill-continuous(
..args,
)Parameters
| Parameter | Default | Description |
|---|---|---|
..args |
Returns
Scale object consumed by plot.
Examples
Default ramp filling bars by their numeric value.
#let d = (
(grp: "a", y: 1),
(grp: "b", y: 2),
(grp: "c", y: 3),
)
#plot(
data: d,
mapping: aes(x: "grp", y: "y", fill: "y"),
layers: (geom-col(),),
scales: (scale-fill-continuous(),),
width: 10cm,
height: 6cm,
)The default ramp shown as a continuous swatch via geom-rect over a sampled gradient.
#let d = range(0, 16).map(i => (
xmin: i, xmax: i + 1, ymin: 0, ymax: 1, z: i,
))
#plot(
data: d,
mapping: aes(xmin: "xmin", xmax: "xmax", ymin: "ymin", ymax: "ymax", fill: "z"),
layers: (geom-rect(),),
scales: (scale-fill-continuous(),),
guides: guides(fill: guide-none()),
width: 10cm,
height: 1cm,
)See also
scale-fill-viridis-c, scale-fill-discrete, scale-colour-continuous.