Skip to content

Commit

Permalink
Document vector passing to nudge_y/nudge_x/position_nudge (#6335)
Browse files Browse the repository at this point in the history
* Document vector passing to position_nudge

* Put nudge_y into aes call

As discussed in #6355.

* Update documentation

* redocument

---------

Co-authored-by: Teun van den Brand <[email protected]>
  • Loading branch information
MaxAtoms and teunbrand authored Feb 25, 2025
1 parent d835cfe commit d1fb550
Show file tree
Hide file tree
Showing 2 changed files with 10 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
5 changes: 5 additions & 0 deletions man/position_nudge.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit d1fb550

Please sign in to comment.