Skip to content

Commit

Permalink
Document vector passing to position_nudge
Browse files Browse the repository at this point in the history
  • Loading branch information
MaxAtoms committed Feb 18, 2025
1 parent d835cfe commit 876cce6
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions R/position-nudge.R
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,11 @@
#' ggplot(df, aes(x, y)) +
#' geom_point() +
#' geom_text(aes(label = y), nudge_y = -0.1)
#'
#' # For each text individually
#' ggplot(df, aes(x, y)) +
#' geom_point() +
#' geom_text(aes(label = y), nudge_y = c(-0.1, 0.1, -0.1, 0.1))
position_nudge <- function(x = NULL, y = NULL) {
ggproto(NULL, PositionNudge,
x = x,
Expand Down

0 comments on commit 876cce6

Please sign in to comment.