theme-sub-axis-bottom

Shortcut for the bottom x axis only.

Usage

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

Parameters

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

Returns

Theme dictionary scoped to the bottom x axis.

Examples

Tint only the bottom x 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-bottom(
    title: red-text,
    text: red-text,
    line: red-line,
    ticks: red-line,
  ),
  width: 10cm,
  height: 6cm,
)

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

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

See also

theme-sub-axis-x, theme-sub-axis-top.

Back to top