Text labels repel away from each other, away from data points, and away from edges of the plotting area.
Two main functions:
geom_text_repel()
geom_label_repel()
geom_text()
and
geom_text_repel()
ggrepel provides additional options for geom_text_repel
and geom_label_repel
:
Option | Description |
---|---|
force |
force of repulsion between overlapping text labels |
direction |
move text labels “both” (default), “x”, or “y” directions |
max.iter |
maximum number of iterations to try to resolve overlaps |
nudge_x |
adjust the starting x position of the text label |
nudge_y |
adjust the starting y position of the text label |
segment.color |
line segment color |
segment.size |
line segment thickness |
segment.curvature |
numeric, negative for left-hand and positive for right-hand curves, 0 for straight lines |
segment.angle |
0-180, less than 90 skews control points toward the start point |
arrow |
render line segment as an arrow with grid::arrow() |