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
)A Layer to add with +.
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