geom-blank

Invisible layer used to extend trained scales without drawing marks.

Since 0.0.1.

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,
  stat: "identity",
  position: "identity",
  key: auto,
  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, or a function applied to the plot data returning the layer frame. Falls back to the plot data when none.
stat "identity" Statistical transform name or stat object.
position "identity" Position adjustment name. Usually left at "identity".
key auto Legend glyph override built with a draw-key-* helper. auto picks the default for the geom.
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