title: How to highlight time ranges on a plot?
body: <p>I have a few signals sampled over time which I plot in R using continuous lines. Additionally, I would like to highlight several specific time ranges on the plot. </p>
  
  <p>My current approach is to draw full-height transparent rectangles with appropriate width and horizontal position which match the time range. I think this is a good representation, as it clearly separates points inside the range from those outside of it; but are there better ones?</p>
  
  <hr>
  
  <p>And the second, practical part of the question. Now I'm plotting the signals like this:</p>
  
  <pre><code>p &lt;- ggplot(data=gs, mapping=aes(x=frameno, y=value, col=variable)) +
         geom_line()
  p
  </code></pre>
  
  <p>I have tried to draw an alpha blended rectangle manually:</p>
  
  <pre><code>p + geom_rect(aes(xmin=600, xmax=650, ymin=-3, ymax=3),
                colour=alpha("grey20", 0.5), fill.alpha=0.5)
  </code></pre>
  
  <p>— but no success so far. Any hints?</p>