 <p>You could generate the groupings using <code>cut</code> and then use a <code>facet_grid</code> to display the multiple histograms:</p> <pre><code># Sample data with y depending on x set.seed(144) dat &lt;- data.frame(x=rnorm(1000)) dat$y &lt;- dat$x + rnorm(1000) # Generate bins of x values dat$grp &lt;- cut(dat$x, breaks=2) # Plot library(ggplot2) ggplot(dat, aes(x=y)) + geom_histogram() + facet_grid(grp~.) </code></pre> <p><img src="https://i.stack.imgur.com/fHzq6.png" alt="enter image description here"></p>