scale-fill-viridis-c

Continuous viridis fill scale.

option selects between "viridis", "magma", "plasma", "inferno", and "cividis".

Usage

scale-fill-viridis-c(
  ..args,
)

Parameters

Parameter Default Description
..args

Returns

Scale object consumed by plot.

Examples

Default viridis ramp filling bars by their numeric value.

#let d = range(0, 12).map(i => (grp: str(i), y: i + 1))
#plot(
  data: d,
  mapping: aes(x: "grp", y: "y", fill: "y"),
  layers: (geom-col(),),
  scales: (scale-fill-viridis-c(option: "viridis"),),
  width: 10cm,
  height: 6cm,
)

Bar chart of twelve increasing bars filled along the continuous viridis ramp from dark purple at low y to bright yellow at high y.

Bar chart of twelve increasing bars filled along the continuous viridis ramp from dark purple at low y to bright yellow at high y.

The viridis ramp shown as a continuous swatch via geom-rect.

#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-viridis-c(),),
  guides: guides(fill: guide-none()),
  width: 10cm,
  height: 1cm,
)

Colour-bar swatch of sixteen rectangles displaying the continuous viridis fill ramp from dark purple on the left to bright yellow on the right.

Colour-bar swatch of sixteen rectangles displaying the continuous viridis fill ramp from dark purple on the left to bright yellow on the right.

See also

scale-fill-viridis-d, scale-fill-viridis-b, scale-colour-viridis-c.

Back to top