Lollipop Chart
ggplot2: geom_segment() + geom_point() · Package: ggplot2 · Variables: 1 categorical + 1 numerical
WHAT IS A LOLLIPOP CHART?
A lollipop chart uses a thin line capped with a dot instead of a thick bar, providing a cleaner and less cluttered alternative to bar charts — especially when you have many categories. The visual emphasis falls on the endpoint (the dot) rather than the bar area, making it easier to read precise values. Lollipop charts are popular for displaying ranked data, feature importance scores in machine learning, and any comparison where visual weight of bars would be distracting. In ggplot2, combine geom_segment() (for the stick) with geom_point() (for the dot).
BEST FOR
- · Many categories with less clutter
- · Ranked data visualization
- · Feature importance scores
AVOID WHEN
- · Very few categories
- · When filled bar weight conveys meaning
R + GGPLOT2 CODE EXAMPLE
df <- data.frame(car = rownames(mtcars)[1:10], mpg = mtcars$mpg[1:10]) ggplot(df, aes(x = reorder(car, mpg), y = mpg)) + geom_segment(aes(xend = car, y = 0, yend = mpg), color = "grey60") + geom_point(color = "#ff6a00", size = 3) + coord_flip() + labs(title = "MPG Lollipop Chart", x = NULL, y = "MPG")
Run this code now
Paste the code above into RChat and see the lollipop chart rendered instantly in your browser.