The same plot in 14 other libraries — Python: Altair, Bokeh, lets-plot, Matplotlib, Plotly, plotnine, Pygal, Seaborn; Julia: Makie.jl; JavaScript: Chart.js, D3.js, Apache ECharts, Highcharts, MUI X Charts. Compare all 15 side by side: Basic Bump Chart in Python, R, Julia and JavaScript.
A bump chart visualizes how rankings change over time by plotting rank positions and connecting them with lines. Unlike line charts that show values, bump charts focus specifically on ordinal rankings, making it easy to track position changes, overtakes, and rank stability across time periods.

#' anyplot.ai
#' bump-basic: Basic Bump Chart
#' Library: ggplot2 4.0.3 | R 4.6.1
#' Quality: 85/100 | Updated: 2026-11-27
library(ggplot2)
library(ragg)
# Theme tokens (Imprint palette, theme-adaptive chrome)
THEME <- Sys.getenv("ANYPLOT_THEME", "light")
PAGE_BG <- if (THEME == "light") "#FAF8F1" else "#1A1A17"
INK <- if (THEME == "light") "#1A1A17" else "#F0EFE8"
INK_SOFT <- if (THEME == "light") "#4A4A44" else "#B8B7B0"
GRID <- alpha(INK, 0.15)
# Imprint palette (canonical order)
IMPRINT_PALETTE <- c("#009E73", "#C475FD", "#4467A3", "#BD8233",
"#AE3030", "#2ABCCD", "#954477", "#99B314")
# Columns: set these to your table's column names
RACE <- "Race round" # role: period
DRIVER <- "Driver" # role: entity
RANK <- "Championship position" # role: rank
# Data: F1 championship standings over 8 rounds; replace with your own table
set.seed(42)
drivers <- c("Hamilton", "Verstappen", "Leclerc", "Norris", "Russell", "Perez")
df <- tibble::tibble(
!!RACE := rep(1:8, each = 6),
!!DRIVER := factor(rep(drivers, times = 8), levels = drivers),
!!RANK := c(
2, 1, 3, 5, 4, 6,
1, 2, 3, 5, 4, 6,
1, 2, 4, 3, 5, 6,
2, 1, 4, 3, 5, 6,
2, 1, 3, 4, 5, 6,
2, 1, 3, 4, 6, 5,
1, 2, 3, 4, 6, 5,
1, 2, 3, 5, 6, 4
)
)
# Plot: reads only df and the constants above
n_races <- max(df[[RACE]])
n_ranks <- max(df[[RANK]])
labels_end <- df[df[[RACE]] == n_races, ]
p <- ggplot(df, aes(x = .data[[RACE]], y = .data[[RANK]],
color = .data[[DRIVER]], group = .data[[DRIVER]])) +
geom_line(linewidth = 1.4, lineend = "round", linejoin = "round") +
geom_point(size = 3.5) +
geom_text(
data = labels_end,
aes(x = .data[[RACE]] + 0.3, label = .data[[DRIVER]]),
hjust = 0,
size = 4.2,
fontface = "bold"
) +
scale_y_reverse(
breaks = seq_len(n_ranks),
labels = \(r) paste0(r, c("st", "nd", "rd", rep("th", 7))[r]),
expand = expansion(add = 0.4)
) +
scale_x_continuous(
breaks = seq_len(n_races),
labels = \(b) paste0("R", b),
expand = expansion(mult = c(0.03, 0.22))
) +
scale_color_manual(values = IMPRINT_PALETTE) +
labs(
title = "bump-basic · r · ggplot2 · anyplot.ai",
x = RACE,
y = RANK
) +
theme_minimal(base_size = 8) +
theme(
plot.background = element_rect(fill = PAGE_BG, color = PAGE_BG),
panel.background = element_rect(fill = PAGE_BG, color = NA),
panel.grid.major.y = element_line(color = GRID, linewidth = 0.3),
panel.grid.major.x = element_blank(),
panel.grid.minor = element_blank(),
axis.title = element_text(color = INK, size = 10),
axis.text = element_text(color = INK_SOFT, size = 8),
axis.line.x = element_line(color = INK_SOFT, linewidth = 0.3),
plot.title = element_text(color = INK, size = 12, face = "bold"),
legend.position = "none",
plot.margin = margin(t = 18, r = 24, b = 18, l = 12, unit = "pt")
)
# Save
ggsave(
filename = sprintf("plot-%s.png", THEME),
plot = p,
device = ragg::agg_png,
width = 8,
height = 4.5,
units = "in",
dpi = 400
)
Runnable source as JSON, for any HTTP client: https://api.anyplot.ai/specs/bump-basic/ggplot2/code. Any spec id and library id listed in llms-full.txt fit the same URL shape; every URL below is complete and callable.
{
"spec_id": "bump-basic",
"language": "r",
"library": "ggplot2",
"page": "https://anyplot.ai/bump-basic/r/ggplot2",
"hub": "https://anyplot.ai/bump-basic",
"code_json": "https://api.anyplot.ai/specs/bump-basic/ggplot2/code",
"spec_json": "https://api.anyplot.ai/specs/bump-basic",
"render_light_png": "https://storage.googleapis.com/anyplot-images/plots/bump-basic/r/ggplot2/plot-light.png",
"render_dark_png": "https://storage.googleapis.com/anyplot-images/plots/bump-basic/r/ggplot2/plot-dark.png",
"quality_score": 85.0,
"license": "MIT",
"guide": "https://anyplot.ai/llms.txt"
}Part of Basic Bump Chart on anyplot.ai.