ggrepel provides geoms for ggplot2 to repel overlapping text labels:
Text labels repel away from each other, away from data points, and away from edges of the plotting area.
library(ggrepel) ggplot(mtcars, aes(wt, mpg, label = rownames(mtcars))) + geom_text_repel() + geom_point(color = 'red') + theme_classic(base_size = 16)
Check out the examples to learn how to use ggrepel in your project.
See our collection of related work for similar R packages, Python packages, and more.
If you have an issue with ggrepel or ggplot2, someone might already have experienced it. Try searching the web, or create a new post:
Thanks to everyone who has contributed pull requests, opened issues, asked questions, and shared examples!
And thanks to Allison Horst for the beautiful artwork!