geom-blank

Invisible layer used to extend trained scales without drawing marks.

Typical mappings are x and / or y; any aesthetic in the mapping participates in scale training so the panel reserves room for the implied range.

Usage

geom-blank(
  mapping: none,
  data: none,
  inherit-aes: true,
)

Parameters

Parameter Default Description
mapping none Layer-specific aesthetic mapping built with aes. Falls back to the plot mapping when none.
data none Layer-specific dataset. Falls back to the plot data when none.
inherit-aes true Whether to merge the plot-level mapping into this layer’s mapping.

Returns

Layer dictionary consumed by plot.

Examples

Two corner rows train the axes without drawing any marks.

#let frame = ((x: 0, y: 0), (x: 10, y: 5))
#plot(
  data: frame,
  mapping: aes(x: "x", y: "y"),
  layers: (geom-blank(),),
  width: 10cm,
  height: 6cm,
)

Empty plot panel with x axis from 0 to 10 and y axis from 0 to 5 trained by two corner rows but no marks drawn.

Empty plot panel with x axis from 0 to 10 and y axis from 0 to 5 trained by two corner rows but no marks drawn.

Stack a blank under geom-function to reserve room for the curve’s domain without overriding the function output.

#let frame = ((x: -2, y: -1), (x: 2, y: 4))
#plot(
  data: frame,
  mapping: aes(x: "x", y: "y"),
  layers: (
    geom-blank(),
    geom-function(fun: x => x * x),
  ),
  width: 10cm,
  height: 6cm,
)

Parabola y = x^2 over x from -2 to 2 with a blank layer reserving the panel range from y = -1 to 4.

Parabola y = x^2 over x from -2 to 2 with a blank layer reserving the panel range from y = -1 to 4.

See also

geom-rug, geom-function.

Back to top