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

stat_summary_hex() brings values or bins out of order #5101

Closed
aricht opened this issue Dec 9, 2022 · 1 comment
Closed

stat_summary_hex() brings values or bins out of order #5101

aricht opened this issue Dec 9, 2022 · 1 comment

Comments

@aricht
Copy link

aricht commented Dec 9, 2022

Hi all,
plotting with stat_summary_hex() the resulting plot does not look as expected and seems to not represent the underlying data. The difference to a plot generated with stat_summary_2d() is striking, when I would expect them to look very similar.
I observed this problem in ggplot2_3.4.0 but not ggplot2_3.3.5.

The problem can be seen on the example data:

library(ggplot2)
d <- ggplot(diamonds, aes(carat, depth, z = price))

d + stat_summary_2d()

d + stat_summary_hex()

Thanks a lot in advance for looking into this!

Screenshot 2022-12-09 at 15 39 41
Screenshot 2022-12-09 at 15 39 15

@yutannihilation
Copy link
Member

Thanks for reporting, this is already fixed in the dev version (#5045).

library(ggplot2)

d <- ggplot(diamonds, aes(carat, depth, z = price))

d + stat_summary_2d()

d + stat_summary_hex()

Created on 2022-12-10 with reprex v2.0.2

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