Open yutannihilation opened 4 days ago
Reopen #4286, which aimed to fix #4285.
As suggested by @teunbrand, I confirmed now the code works without the as.numeric() tweak if I merge the changes of #5640.
as.numeric()
mydata <- data.frame( x = factor(c("1", "2", "3")), y = c(3, 4, 5) ) mydata$splits <- factor(mydata$x, labels = c("baseline", "Cycle 1", "Cycle 1")) devtools::load_all("~/GitHub/ggplot2/") #> ℹ Loading ggplot2
pos <- position_nudge(x = -0.1) # works ggplot(mydata, aes(x, y)) + geom_point(size = 3, position = pos) + geom_vline( aes(xintercept = as.numeric(x)), alpha = 0.2, linewidth = 5, colour = "red", position = pos )
# didn't work, but now works! ggplot(mydata, aes(x, y)) + geom_point(size = 3, position = pos) + geom_vline( aes(xintercept = x), alpha = 0.2, linewidth = 5, colour = "red", position = pos )
Created on 2024-07-01 with reprex v2.1.0
Thanks! Added a news bullet. I think this should be merged after #5640 gets merged because the soundness relies on it, but please feel free to merge early if you want.
Reopen #4286, which aimed to fix #4285.
As suggested by @teunbrand, I confirmed now the code works without the
as.numeric()
tweak if I merge the changes of #5640.Created on 2024-07-01 with reprex v2.1.0