One density curve per group, offset vertically so distributions can be compared at a glance. Groups are ordered by their factor levels, first level at the bottom.

geom_ridgeline(
  mapping = NULL,
  data = NULL,
  scale = 1.6,
  color = NULL,
  alpha = NULL,
  linewidth = NULL,
  bw = NULL
)

Arguments

mapping, data

Standard layer overrides. Map the value to x and the group to y (or color).

scale

Height of each ridge as a multiple of the row spacing; values above 1 make ridges overlap.

color, alpha, linewidth

Appearance.

bw

Density bandwidth; NULL uses a Silverman rule of thumb.

Value

A Layer to add with +.

Examples

ggnext(iris, aes(Sepal.Length, Species)) + geom_ridgeline()
#> <ggnext plot>
#>   data:  150 x 5
#>   aes:   x = Sepal.Length, y = Species
#>   layers: 1 
#>   coord: cartesian
#>   mode:  static