I am creating binhex plots of data points bordering different groups. Each group potentially has a different total number of points, therefore, and not every bin value, which is the absolute number of points, I would like this percentage to the total amount of points in this group. Here is what I'm trying now:
d <- data.frame(grp= c(rep('a',10000), rep('b',5000)), x= rnorm(15000), y= rnorm(15000)) ggplot(d, aes(x= x, y= y)) + stat_binhex(aes(fill= ..count../sum(..count..)*100)) + facet_wrap(~grp)
It is right? Is sum(..count..) total points based on each face (10000 for group “a” and 5000 for group “b”), or does this result in 15000 for both fascia?
source share