View source: R/gglyph.repel.control.R
gglyph.repel.control | R Documentation |
Set the contol parameters for the repel algorithm
\insertCiteslowikowski_ggrepel_2021gglyph used in various geoms
(geom_*()
) implemented in gglyph
to repel the glyphs from each
other.
gglyph.repel.control( box.padding = 0.25, point.padding = 1e-06, min.segment.length = 0.5, arrow = NULL, force = 1, force_pull = 1, max.time = 0.5, max.iter = 10000, max.overlaps = getOption("ggrepel.max.overlaps", default = 10), nudge_x = 0, nudge_y = 0, xlim = c(NA, NA), ylim = c(NA, NA), direction = c("both", "y", "x"), seed = NA, verbose = FALSE )
box.padding |
Amount of padding around bounding box, as unit or number.
Defaults to 0.25. (Default unit is lines, but other units can be specified
by passing |
point.padding |
Amount of padding around labeled point, as unit or
number. Defaults to 0. (Default unit is lines, but other units can be
specified by passing |
min.segment.length |
Skip drawing segments shorter than this, as unit or
number. Defaults to 0.5. (Default unit is lines, but other units can be
specified by passing |
arrow |
specification for arrow heads, as created by
|
force |
Force of repulsion between overlapping glyphs. Defaults to 1. |
force_pull |
Force of attraction between a glyph and its corresponding data point. Defaults to 1. |
max.time |
Maximum number of seconds to try to resolve overlaps. Defaults to 0.5. |
max.iter |
Maximum number of iterations to try to resolve overlaps. Defaults to 10000. |
max.overlaps |
Exclude glyphs that overlap too many things. Defaults to 10. |
nudge_x, nudge_y |
Horizontal and vertical adjustments to nudge the
starting position of each glyph. The units for |
xlim, ylim |
Limits for the x and y axes. Glyphs will be constrained to these limits. By default, glyphs are constrained to the entire plot area. |
direction |
"both", "x", or "y" – direction in which to adjust position of glyphs. |
seed |
Random seed passed to |
verbose |
If |
A list with the following components to control the repel algorithm corresponding to the same in Arguments.
box.padding |
|
point.padding |
|
min.segment.length |
|
arrow |
|
force |
|
force_pull |
|
max.time |
|
max.iter |
|
max.overlaps |
|
nudge_x, nudge_y |
|
xlim, ylim |
|
direction |
|
seed |
|
verbose |
ggrepel
# Adjust force gglyph.repel.control(force = 0.5) # Adjust max.iter gglyph.repel.control(max.iter = 5000)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.