scale-log10

Position scale on a base-10 log axis (x or y).

All mapped values must be strictly positive.

Usage

scale-log10(
  ..args,
)

Parameters

Parameter Default Description
..args Named arguments forwarded to the axis scale (e.g. name, limits, breaks, minor-breaks, n-minor, labels).

Returns

Deferred scale spec consumed by scales.

Examples

Compress an exponential growth curve onto a log-10 y axis.

#let d = range(1, 11).map(i => (x: i, y: calc.pow(2, i)))
#plot(
  data: d,
  mapping: aes(x: "x", y: "y"),
  layers: (geom-point(size: 2pt),),
  scales: scales(y: scale-log10(name: "Value")),
  width: 10cm,
  height: 6cm,
)

Scatter chart of ten exponential values where a log10 y axis compresses the steep curve into an evenly spaced sequence of points.

Scatter chart of ten exponential values where a log10 y axis compresses the steep curve into an evenly spaced sequence of points.

See also

scales, scale-continuous, scale-sqrt.

Back to top