Dumbbell Chart
ggplot2: geom_segment() + geom_point() · Package: ggplot2 · Variables: 1 categorical + 2 numerical
WHAT IS A DUMBBELL CHART?
A dumbbell chart (also called a connected dot plot or gap chart) shows two values per category connected by a line segment, highlighting the gap or change between them. It is ideal for before/after comparisons, year-over-year changes, or showing the difference between two conditions (e.g., male vs female, plan vs actual). The visual emphasis is on the magnitude of the gap, not the absolute values. Dumbbell charts are more compact and elegant than grouped bar charts for pairwise comparisons. In ggplot2, combine geom_segment() for the connecting line with two geom_point() layers for the endpoints.
BEST FOR
- · Before/after comparisons
- · Gap analysis between two values
- · Period-over-period change
AVOID WHEN
- · More than 2 comparison points
- · Very few categories
- · When absolute values matter more than gap
R + GGPLOT2 CODE EXAMPLE
df <- data.frame(car = rownames(mtcars)[1:8], before = mtcars$mpg[1:8], after = mtcars$mpg[1:8] + sample(-3:5, 8, TRUE)) ggplot(df, aes(y = reorder(car, before))) + geom_segment(aes(x = before, xend = after, yend = car), color = "grey60") + geom_point(aes(x = before), color = "tomato", size = 3) + geom_point(aes(x = after), color = "#ff6a00", size = 3) + labs(title = "Before vs After MPG", x = "MPG", y = NULL)
Run this code now
Paste the code above into RChat and see the dumbbell chart rendered instantly in your browser.