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

hexbin is broken #5037

Closed
mgrabovsky opened this issue Nov 7, 2022 · 2 comments · Fixed by #5045
Closed

hexbin is broken #5037

mgrabovsky opened this issue Nov 7, 2022 · 2 comments · Fixed by #5045

Comments

@mgrabovsky
Copy link

It looks like since at least the latest release (3.4.0) geom_hex is broken in some way. For an example, see the documentation:

image

(Current state on left, expected output on the right.)

@yutannihilation
Copy link
Member

Thanks, confirmed. I'm yet to figure out what's happening here, but it seems #4671 makes this difference.

@micans
Copy link

micans commented Nov 23, 2022

I experienced the same, with very large artefacts -- high density called where density is in fact very low for my actual data of interest.

Applying geom_hex to a simple uniform object shows big differences between version 3.4.0 and 3.3.5:

v <- expand.grid(1:100,1:100)
myscale2 <- scale_fill_gradientn(name = "count",
              trans = "log",
                values=c(0.0,0.4,0.6,0.8,1.0),
                  colors=c("darkblue", "lightblue", "yellow", "orange", "red"),
                    breaks=c(2,4,8,16), labels=c(2,4,8,16))
mybins <- 20
pdf("ggplot340sq100bin20hex.pdf")
ggplot(v, aes(Var1,Var2)) + ggplot2::geom_hex(bins=mybins) + myscale2 + ggtitle("hex")
dev.off()

yields

Screenshot 2022-11-23 at 14 12 37

Whereas for version 335 this gives

Screenshot 2022-11-23 at 14 13 18

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

Successfully merging a pull request may close this issue.

3 participants