Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Swap of dodge position in ggbeeswarm::geom_beeswarm() since v3.5.1.9000 #6299

Closed
jbengler opened this issue Jan 22, 2025 · 2 comments
Closed

Comments

@jbengler
Copy link

Example code

ggplot(mtcars, aes(x = factor(cyl), y = disp, color = factor(am))) +
  geom_boxplot(position = position_dodge(width = 0.8)) +
  ggbeeswarm::geom_beeswarm(dodge.width = 0.8)

Output in ggplot v3.5.1

Image

Output in ggplot v3.5.1.9000

Image

@teunbrand
Copy link
Collaborator

Thanks for the report Jan!

The PR that affected this behaviour is #5923.
To summarise that PR as it relates to the issue you describe, ggplot2's internal default is to reverse the order, but the default as it comes down from users is to not reverse the order.

AFAICT, {ggbeeswarm} uses the ggplot2:::pos_dodge() function here.
This is an unexported, internal function where we do not guarantee any stability as it is not part of the API (where at least attempt some stability). For more info, see e.g. https://www.tidyverse.org/blog/2022/09/playing-on-the-same-team-as-your-dependecy/#using-.

I'm not willing to reverse course in ggplot2 because ggbeeswarm uses an internal function, so I'm going to close this issue.

@jbengler
Copy link
Author

Hey Teun,

thank you very much for looking into this!

I will open an issue over at {ggbeeswarm}

Best
Jan

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants