scale-colour-viridis-c

Continuous viridis colour scale.

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

Usage

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

Parameters

Parameter Default Description
..args

Returns

Scale object consumed by plot.

Examples

Magma option applied to a continuous numeric column.

#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-viridis-c(option: "magma"),),
  width: 10cm,
  height: 6cm,
)

Scatter chart of twelve diagonal points coloured by z along a continuous magma ramp from black at low values through purple-red to pale yellow at high.

Scatter chart of twelve diagonal points coloured by z along a continuous magma ramp from black at low values through purple-red to pale yellow at high.

Default "viridis" ramp with limits clipping the lower tail.

#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-viridis-c(limits: (2, 6)),),
  width: 10cm,
  height: 6cm,
)

Scatter chart of twelve diagonal points coloured along the viridis ramp from purple to yellow, with limits 2 through 6 clamping the lower tail to the dark end.

Scatter chart of twelve diagonal points coloured along the viridis ramp from purple to yellow, with limits 2 through 6 clamping the lower tail to the dark end.

See also

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

Back to top