We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
library(ggplot2) dat <- data.frame(x = rnorm(100000, 0, 5), y = rnorm(100000, 0, 5), z = rnorm(100000, 42, 42)) hexHist = ggplot(dat, aes(x, y, z = z)) + stat_binhex(bins = 10) + stat_summary_hex(aes(label=..value..), bins = 10, fun = function(z) { (round(sum(z)/length(z), 0)) }, geom = "text")
And, if we look at the bin centers of ggplot_build():
ggplot_build()
hexDat = ggplot_build(hexHist)$data[[1]] hexHist2 = hexHist + annotate("text", hexDat$x, hexDat$y, label = "o")
I've been told that some tiles that are supposed to be there aren't being plotted.
The text was updated successfully, but these errors were encountered:
Simpler reprex:
set.seed(12) n <- 1e4 dat <- data.frame(x = rnorm(n, 0, 5), y = rnorm(n, 0, 5)) ggplot(dat, aes(x, y, z = x)) + stat_binhex(bins = 10) + stat_summary_hex(bins = 10, fun = length, geom = "point", colour = "red")
Not only are points misaligned, some coloured cells don't have red points and vice versa.
Sorry, something went wrong.
Even simpler, and calibrated with geom_point(): suggests that the bug is in stat_summary_hex():
geom_point()
stat_summary_hex()
set.seed(12) n <- 1e2 dat <- data.frame(x = rnorm(n, 0, 5), y = rnorm(n, 0, 5)) ggplot(dat, aes(x, y, z = x)) + stat_binhex(bins = 10) + geom_point(colour = "white") + guides(fill = "legend") ggplot(dat, aes(x, y, z = x)) + stat_binhex(bins = 10) + stat_summary_hex(bins = 10, fun = length, geom = "point", colour = "red")
f7cb898
No branches or pull requests
And, if we look at the bin centers of
ggplot_build()
:I've been told that some tiles that are supposed to be there aren't being plotted.
The text was updated successfully, but these errors were encountered: