Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

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

License

NotificationsYou must be signed in to change notification settings

slowkow/ggrepel

Repository files navigation

Build StatusCRAN_Status_BadgeCRAN_Downloads_Badge

Overview

ggrepel provides geoms forggplot2 to repel overlapping text labels:

  • geom_text_repel()
  • geom_label_repel()

Text labels repel away from each other, away from data points, and awayfrom 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)

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 theexamples page to learn more about how to use ggrepel in your project.

Examples

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

Hide some of the labelsAlways show all labels, even when they have too many overlapsDo not repel labels from data pointsDo not repel labels from plot (panel) edgesExpand the scale to make room for labelsAlways (or never) draw line segmentsMake curved line segments or arrowsRepel labels from data points with differentsizesLimit labels to a specific areaRemove “a” from the legendAlign labels on the top or bottom edgeAlign labels on the left or right edgeUsing ggrepel with stat_summary()Justify multiple lines of text with hjustLabel jittered pointsNudge labels in different directions with ggppLabel sf objectsShadows (or glow) under text labelsVerbose timing informationWord cloudPolar coordinatesUnicode characters (Japanese)Mathematical expressions

Contributing

Pleasesubmit an issue to report bugs or ask questions.

Please contribute bug fixes or new features with apull request to thisrepository.

About

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

Topics

Resources

License

Stars

Watchers

Forks

Sponsor this project

    Packages

    No packages published

    Contributors19

    Languages


    [8]ページ先頭

    ©2009-2025 Movatter.jp