slowkow
ggrepel
R

:round_pushpin: Repel overlapping text labels away from each other in your ggplot2 figures.

Last updated Jul 2, 2026
1.3k
Stars
96
Forks
26
Issues
0
Stars/day
Attention Score
95
Language breakdown
No language data available.
Files click to expand
README

ggrepel ============================================

[![Build Status][bb]][githubactions] [![CRANStatusBadge][cb]][cran] [![CRANDownloadsBadge][db]][r-pkg]

[bb]: https://github.com/slowkow/ggrepel/workflows/R-CMD-check/badge.svg [githubactions]: https://github.com/slowkow/ggrepel/actions?query=workflow%3AR-CMD-check

[cb]: https://www.r-pkg.org/badges/version/ggrepel?color=blue [cran]: https://CRAN.R-project.org/package=ggrepel

[db]: https://cranlogs.r-pkg.org/badges/ggrepel [r-pkg]: https://cranlogs.r-pkg.org

Overview


ggrepel provides geoms for [ggplot2] to repel overlapping text labels:

[ggplot2]: https://ggplot2.tidyverse.org

  • geomtextrepel()
  • geomlabelrepel()
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))) +
  geomtextrepel() +
  geom_point(color = 'red') +
  themeclassic(basesize = 16)

Installation


# The easiest way to get ggrepel is to install it from CRAN:
install.packages("ggrepel")

Or get the the development version from GitHub:

install.packages("devtools")

devtools::install_github("slowkow/ggrepel")

Usage


See the [examples] page to learn more about how to use ggrepel in your project.

[examples]: https://ggrepel.slowkow.com/articles/examples.html

Examples


Click one of the images below to go to see the code example:

Hide some of the labels Always show all labels, even when they have too many overlaps Do not repel labels from data points Do not repel labels from plot (panel) edges Expand the scale to make room for labels Always (or never) draw line segments Make curved line segments or arrows Repel labels from data points with different sizes Limit labels to a specific area Remove “a” from the legend Align labels on the top or bottom edge Align labels on the left or right edge Using ggrepel with stat</em>summary() Justify multiple lines of text with hjust Label jittered points Nudge labels in different directions with ggpp Label sf objects Shadows (or glow) under text labels Verbose timing information Word cloud Polar coordinates Unicode characters (Japanese) Mathematical expressions

Contributing


Please [submit an issue][issues] to report bugs or ask questions.

Please contribute bug fixes or new features with a [pull request][pull] to this repository.

[issues]: https://github.com/slowkow/ggrepel/issues [pull]: https://help.github.com/articles/using-pull-requests/

🔗 More in this category

© 2026 GitRepoTrend · slowkow/ggrepel · Updated daily from GitHub