title: Combining 2 plots of different data (boxplot and points)
body: <p>I'd like to plot two graphs ontop of each other <a href="https://stackoverflow.com/questions/21192002/how-to-combine-2-plots-ggplot-into-one-plot">like in this post</a>.</p>
  
  <p><strong>Experimental data</strong>: I have continuous variable displaying the angle of wind on a given day in a list called <code>expt$iso_xs[,8]</code>, I then have the wind speed corresponding to that angle in <code>expt$iso_xs[,2]</code>.</p>
  
  <pre><code>df&lt;-data.frame(expt$iso.xs)
  
  head(expt$iso.xs)
           [,1]     [,2]     [,3]      [,4]      [,5] [,6] [,7]   [,8]
   736105.4 16.62729 2.183740  7.234774 0.9791632 4.01 4.20 238.62
   736105.4 18.96705 2.489668  7.036234 0.9640366 3.82 4.00 243.14
   736105.5 20.52089 2.687636 10.355394 1.3698454 4.99 5.14 247.02
   736105.5 19.94449 2.611556 10.306912 1.3655301 4.85 5.12 249.57
   736105.5 19.43309 2.551787 11.098302 1.4646251 4.83 5.12 243.89
   736105.5 20.48259 2.689075 11.928011 1.5710530 4.89 5.09 254.23
  </code></pre>
  
  <p>Which looks like this:
  <a href="https://i.stack.imgur.com/kj2q5.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/kj2q5.png" alt="enter image description here"></a></p>
  
  <p><strong>Simulation data</strong>: I have a data.frame <code>z</code> that contains predictions for a subset of the above angles (0-90º).</p>
  
  <pre><code>head(z,15)
     Tracer angle treatment bigangle
    71.101     0         S      150
    71.101     0         S      150
    71.105     15         S      165
    71.105     15         S      165
    71.098     30         S      180
    71.098     45         S      195
    71.114     60         S      210
    71.114     80         S      230
    71.110     90         S      240
  </code></pre>
  
  <p>Plotting it using bigangle as factor and Tracer as :</p>
  
  <pre><code>ggplot() +
    geom_boxplot(data=z, aes(y = (3600/Tracer/93.241), x = factor(bigangle)),outlier.shape = NA,outlier.colour = NA)+
    coord_cartesian(ylim=c(0, 1))+
    labs(x = "Angle", y = "Normalised ACh" )+
    scale_x_discrete(labels=seq(0,360,10))+
    theme_classic()
  </code></pre>
  
  <p>looks like this:</p>
  
  <p><a href="https://i.stack.imgur.com/KWnCQ.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/KWnCQ.png" alt="enter image description here"></a></p>
  
  <p>I'd like to superimpose the boxplot ontop of the portion of red points (between 150º and 240º) but the following doesn't work:</p>
  
  <pre><code>ggplot() +
        geom_boxplot(data=z, aes(y = (3600/Tracer/93.241), x = factor(bigangle)),outlier.shape = NA,outlier.colour = NA)+
        geom_point(data=df, aes(y = X2/45, x = X8),color="red")+
        coord_cartesian(ylim=c(0, 1))+
        labs(x = "Angle", y = "Normalised ACh" )+
        scale_x_discrete(labels=seq(0,360,10))+
        theme_classic()
  </code></pre>
  
  <p><a href="https://i.stack.imgur.com/1cN6k.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/1cN6k.png" alt="enter image description here"></a></p>
  
  <p>Any thoughts would be much appreciated,
  Cheers</p>