title: ggplot2: How to combine histogram, rug plot, and logistic regression prediction in a single graph
body: <p>I am trying to plot combined graphs for logistic regressions as the function <a href="http://www.inside-r.org/packages/cran/popbio/docs/logi.hist.plot" rel="noreferrer">logi.hist.plot</a> but I would like to do it using <a href="http://ggplot2.org/" rel="noreferrer">ggplot2</a> (aesthetic reasons).</p>
  
  <p>The problem is that only one of the histograms should have the scale_y_reverse().</p>
  
  <p>Is there any way to specify this in a single plot (see code below) or to overlap the two histograms by using coordinates that can be passed to the previous plot?</p>
  
  <pre><code>ggplot(dat) + 
      geom_point(aes(x=ind, y=dep)) + 
      stat_smooth(aes(x=ind, y=dep), method=glm, method.args=list(family="binomial"), se=FALSE) + 
      geom_histogram(data=dat[dat$dep==0,], aes(x=ind)) +
      geom_histogram(data=dat[dat$dep==1,], aes(x=ind)) ## + scale_y_reverse()
  </code></pre>
  
  <p>This final plot is what I have been trying to achieve:</p>
  
  <p><img src="https://i.stack.imgur.com/wDFUJ.png" alt="derisable outcome"></p>