Open teunbrand opened 1 month ago
This PR aims to fix #3610.
Briefly, it adds a reverse argument to position_dodge() and position_jitterdodge() that reverses the groups within a position in terms of dodge order.
reverse
position_dodge()
position_jitterdodge()
As a detail, for consistency with position_dodge2(), we actually pass !reverse to collide().
position_dodge2()
!reverse
collide()
Adapted reprex from issue:
devtools::load_all("~/packages/ggplot2") #> ℹ Loading ggplot2 p <- ggplot(mtcars) + aes( as.factor(cyl), mpg, fill = as.factor(vs), group = interaction(cyl, vs) ) p + geom_boxplot(position = position_dodge(reverse = FALSE)) + geom_point(position = position_jitterdodge(reverse = FALSE), shape = 21)
p + geom_boxplot(position = position_dodge(reverse = TRUE)) + geom_point(position = position_jitterdodge(reverse = TRUE), shape = 21)
Created on 2024-05-31 with reprex v2.1.0
This PR aims to fix #3610.
Briefly, it adds a
reverse
argument toposition_dodge()
andposition_jitterdodge()
that reverses the groups within a position in terms of dodge order.As a detail, for consistency with
position_dodge2()
, we actually pass!reverse
tocollide()
.Adapted reprex from issue:
Created on 2024-05-31 with reprex v2.1.0