theme-sub-axis-left

Shortcut for the left y axis only.

Usage

theme-sub-axis-left(
  title: none,
  text: none,
  line: none,
  ticks: none,
)

Parameters

Parameter Default Description
title none Element override for the left y axis title.
text none Element override for the left y axis tick labels.
line none Element override for the left y axis line.
ticks none Element override for the left y axis ticks.

Returns

Theme dictionary scoped to the left y axis.

Examples

Tint only the left y axis in red; the rest stays default.

#let red-text = element-text(colour: rgb("#cc0000"))
#let red-line = element-line(colour: rgb("#cc0000"))
#let d = range(0, 10).map(i => (x: i, y: i * 0.5))
#plot(
  data: d,
  mapping: aes(x: "x", y: "y"),
  layers: (geom-point(size: 2pt),),
  theme: theme-sub-axis-left(
    title: red-text,
    text: red-text,
    line: red-line,
    ticks: red-line,
  ),
  width: 10cm,
  height: 6cm,
)

Scatter plot of y against x with red left y-axis title, tick labels, axis line and ticks while every other axis stays default.

Scatter plot of y against x with red left y-axis title, tick labels, axis line and ticks while every other axis stays default.

See also

theme-sub-axis-y, theme-sub-axis-right.

Back to top