theme-sub-panel

Shortcut for panel grid and background.

Usage

theme-sub-panel(
  grid: none,
  background: none,
)

Parameters

Parameter Default Description
grid none element-line or element-blank for panel-grid.
background none element-rect or element-blank for panel-background.

Returns

Theme dictionary with the named panel overrides applied.

Examples

Cream panel with a muted brown grid via the panel shortcut.

#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-panel(
    background: element-rect(fill: rgb("#fff7e6")),
    grid: element-line(colour: rgb("#d9cfbf")),
  ),
  width: 10cm,
  height: 6cm,
)

Scatter plot of y against x on a cream-coloured panel background with a muted brown grid applied via the panel shortcut group.

Scatter plot of y against x on a cream-coloured panel background with a muted brown grid applied via the panel shortcut group.

See also

theme.

Back to top