theme-grey

Grey theme: light grey panel with white gridlines.

This is the gribouille default theme.

Usage

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

Parameters

Parameter Default Description
ink _tr-ink Foreground colour (text, axis lines). 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

Library default: light grey panel with white 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-grey(),
  width: 10cm,
  height: 6cm,
)

Scatter plot of y against x on the library default light grey panel with white gridlines and thin black axes.

Scatter plot of y against x on the library default light grey panel with white gridlines and thin black axes.

Override ink and paper for a tinted theme without switching theme function.

#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-grey(ink: rgb("#2c3e50"), paper: rgb("#fdf6e3")),
  width: 10cm,
  height: 6cm,
)

Scatter plot of y against x with dark navy ink on a warm cream background, recolouring the grey theme without changing function.

Scatter plot of y against x with dark navy ink on a warm cream background, recolouring the grey theme without changing function.

Tweak a single field on top of the preset using a flat key.

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

Scatter plot of y against x on the grey preset with the panel background replaced by a warm cream fill via the flat key.

Scatter plot of y against x on the grey preset with the panel background replaced by a warm cream fill via the flat key.

See also

theme-minimal, theme-classic, theme-void, theme.

Back to top