Rank trajectories drawn with sigmoid interpolation between periods, so crossings read cleanly instead of as sharp zigzags.

geom_bump(
  mapping = NULL,
  data = NULL,
  color = NULL,
  alpha = NULL,
  linewidth = NULL,
  points = TRUE
)

Arguments

mapping, data

Standard layer overrides. Map time to x, rank to y, and the series to color.

color, alpha, linewidth

Appearance.

points

Draw a marker at each period.

Value

A Layer to add with +.

Examples

d <- data.frame(
  year = rep(2021:2023, 3),
  rank = c(1, 2, 3, 2, 1, 1, 3, 3, 2),
  team = rep(c("A", "B", "C"), each = 3)
)
ggnext(d, aes(year, rank, color = team)) +
  geom_bump() + scale_y_reverse()
#> <ggnext plot>
#>   data:  9 x 3
#>   aes:   x = year, y = rank, color = team
#>   layers: 1 
#>   coord: cartesian
#>   mode:  static