Skip to content

Commit d1fb550

Browse files
MaxAtomsteunbrand
andauthored
Document vector passing to nudge_y/nudge_x/position_nudge (tidyverse#6335)
* Document vector passing to position_nudge * Put nudge_y into aes call As discussed in tidyverse#6355. * Update documentation * redocument --------- Co-authored-by: Teun van den Brand <[email protected]>
1 parent d835cfe commit d1fb550

File tree

2 files changed

+10
-0
lines changed

2 files changed

+10
-0
lines changed

R/position-nudge.R

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,11 @@
2727
#' ggplot(df, aes(x, y)) +
2828
#' geom_point() +
2929
#' geom_text(aes(label = y), nudge_y = -0.1)
30+
#'
31+
#' # For each text individually
32+
#' ggplot(df, aes(x, y)) +
33+
#' geom_point() +
34+
#' geom_text(aes(label = y, nudge_y = c(-0.1, 0.1, -0.1, 0.1)))
3035
position_nudge <- function(x = NULL, y = NULL) {
3136
ggproto(NULL, PositionNudge,
3237
x = x,

man/position_nudge.Rd

Lines changed: 5 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)