Closed
Description
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()
:
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.