theme-classic

Classic theme: white panel, axis borders, no gridlines.

Usage

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

Parameters

Parameter Default Description
ink _tr-ink Foreground colour (axis lines, text). Default: black.
paper _tr-paper Background colour. Default: white.
accent rgb("#3366FF") Accent colour. 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

Classic axis borders with no gridlines.

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

Scatter plot of y against x with visible black axis borders, a white panel and no gridlines.

Scatter plot of y against x with visible black axis borders, a white panel and no gridlines.

Switch paper to a tinted background while keeping the classic axis style.

#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-classic(paper: rgb("#fff7e6")),
  width: 10cm,
  height: 6cm,
)

Scatter plot of y against x on a warm cream panel with the classic black axis borders and no gridlines.

Scatter plot of y against x on a warm cream panel with the classic black axis borders and no gridlines.

Bump the axis title size on top of the classic preset.

#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-classic(axis-title: element-text(size: 14pt)),
  width: 10cm,
  height: 6cm,
)

Scatter plot of y against x on the classic theme with axis titles rendered in a larger 14pt font.

Scatter plot of y against x on the classic theme with axis titles rendered in a larger 14pt font.

See also

theme-grey, theme-minimal, theme-void, theme.

Back to top