theme-void

Void theme: no axes, no grid, no panel background.

Usage

theme-void(
  ink: _tr-ink,
  paper: auto,
  accent: rgb("#3366FF"),
  ..fields,
)

Parameters

Parameter Default Description
ink _tr-ink Foreground colour. Default: black.
paper auto Plot canvas fill. Default: transparent (no canvas drawn). Pass an explicit colour to paint the canvas behind the otherwise-blank panel.
accent rgb("#3366FF") Accent colour driving layer defaults like geom-smooth’s stroke. Default: rgb("#3366FF").
..fields Extra overrides forwarded to theme; see its docs for the full catalogue of structured and flat keys.

Returns

Theme dictionary consumed by plot.

Examples

Strip away axes, grid, and panel background entirely.

#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-void(),
  width: 10cm,
  height: 6cm,
)

Scatter plot of y against x with axes, gridlines, panel background and tick labels all stripped away.

Scatter plot of y against x with axes, gridlines, panel background and tick labels all stripped away.

Useful behind a custom annotated figure where axes would be visual noise; pass an explicit paper for a solid background.

#let d = range(0, 12).map(i => (
  x: calc.cos(i * 0.5), y: calc.sin(i * 0.5), t: i,
))
#plot(
  data: d,
  mapping: aes(x: "x", y: "y", colour: "t"),
  layers: (geom-path(stroke: 1.4pt),),
  theme: theme-void(paper: rgb("#fff7e6")),
  width: 10cm,
  height: 6cm,
)

Circular path of sine against cosine coloured by time on the void theme over a warm cream canvas without axes or grid.

Circular path of sine against cosine coloured by time on the void theme over a warm cream canvas without axes or grid.

Restore a faint panel background while keeping the void preset’s stripped-down axes.

#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-void(panel-background: element-rect(fill: rgb("#f7f0e7"))),
  width: 10cm,
  height: 6cm,
)

Scatter plot of y against x on the void theme with a faint cream panel background restored beneath the stripped axes.

Scatter plot of y against x on the void theme with a faint cream panel background restored beneath the stripped axes.

See also

theme-grey, theme-minimal, theme-classic, theme.

Back to top