-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Closed
Description
The documentation for 'position_nudge' implies that you should only give one value for nudge, but isn't explicit. I often give different nudge values for each label so I can nudge them in different directions.
This works, but results in a warning. I would suggest fixing the if() statement to check multiple values, or make it explicit that we shouldn't be using more than one nudge value.
Thanks!
library(ggplot2)
df <- data.frame(
x = c(1,3,2,5),
y = c("a","c","d","c")
)
ggplot(df, aes(x, y)) +
geom_point() +
geom_text(aes(label = y), nudge_y = c(-0.1, 0.1, -0.1, -0.1))
#> Warning in if (params$y != 0) {: the condition has length > 1 and only the
#> first element will be used
Created on 2018-11-01 by the reprex package (v0.2.1)
Metadata
Metadata
Assignees
Labels
No labels