Skip to content

Commit 876cce6

Browse files
committed
Document vector passing to position_nudge
1 parent d835cfe commit 876cce6

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-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,

0 commit comments

Comments
 (0)