A short tick per observation along the panel edges, showing the raw values behind a density, smooth, or scatter.

geom_rug(
  mapping = NULL,
  data = NULL,
  sides = NULL,
  length = NULL,
  color = NULL,
  linewidth = NULL,
  alpha = NULL
)

Arguments

mapping, data

Standard layer overrides.

sides

Which edges to draw on, as a string of "t", "r", "b", "l" (default "bl").

length

Tick length as a fraction of the panel.

color, linewidth, alpha

Appearance.

Value

A Layer to add with +.

Examples

ggnext(cars, aes(speed, dist)) + geom_point() + geom_rug()
#> <ggnext plot>
#>   data:  50 x 2
#>   aes:   x = speed, y = dist
#>   layers: 2 
#>   coord: cartesian
#>   mode:  static