Closed francoiskroll closed 1 year ago
Thanks, this seems to be a bug introduced in a recent update, as it works as you describe in v0.6.0 (see below).
I believe the intended behaviour should be the points don't move when coloured, unless position = position_dodge()
is specified.
I'll look into it.
library(ggbeeswarm)
#> Loading required package: ggplot2
packageVersion("ggbeeswarm")
#> [1] '0.6.0'
## Quasirandom
# this is correctly placing the dots:
ggplot(mtcars, aes(x=factor(gear), y=drat)) +
geom_quasirandom()
# still correct
ggplot(mtcars, aes(x=factor(gear), y=drat, color=factor(cyl))) +
geom_quasirandom()
Created on 2023-04-22 with reprex v2.0.2
Thanks for an amazingly useful package!
I am having an odd issue (maybe caused by a recent update?), which I have just posted on StackOverflow:
https://stackoverflow.com/questions/76034230/r-ggplot2-odd-behaviour-of-geom-quasirandom-when-colouring-by-a-factor
Am I doing something stupid?
Edit: adding
group=1
solves this issue (thanks stefan on StackOverflow), like:But I did not have to do this previously, so maybe this is not the expected behaviour regardless?