Hi Michael,
I am trying the solution you've suggested below:
DAT <- data.frame(x = runif(1000, 0, 20), y = rnorm(1000))
DAT$xbin <- with(DAT, cut(x, seq(0, 20, 2)))
p <- ggplot(DAT, aes(x = x, y = y)) + geom_point(alpha = 0.2) +
stat_quantile(aes(colour = ..quantile..), quantiles = seq(0.05, 0.95,
by=0.05)) + facet_wrap(~ xbin, scales = "free")
print(p)
-----------------------
But my big problem is: I don't know how to modify the code above to do it
for "equal # of points" in each bin along the x-axis?
i.e. the 2nd case in the original problem:
2. Equal number of observations in each bin;
?
Thanks a lot!
[[alternative HTML version deleted]]