title: Add horizontal rectangle to categorical boxplot in ggplot2
body: <p>I want to make a boxplot with a horizontal rectangle behind the plots (or above with opacity). I am not sure how to do this with categorical x-axis values and force it to extend the entire width of the plot area. <a href="https://stackoverflow.com/questions/32642856/how-do-i-use-geom-rect-with-discrete-axis-values">This answer</a> was helpful, but I'm not sure how to extend the rectangle to the edges of the plot area.</p>
  
  <p>Let's say we want to make a rectangle across the <code>diamonds</code> cuts between $3000 and $5000. I have attempted the code below, but it doesn't extend to the edge of the plot.</p>
  
  <pre><code>rectangle &lt;- data.frame(x = c("Fair","Good","Very good", "Premium", "Ideal"), 
                      lower = rep(3000, 5),
                      upper = rep(5000, 5))
  ggplot() +
    geom_boxplot(data=diamonds, aes(x=cut, y=price)) +
    geom_rect(data=rectangle, aes(xmin="Fair", xmax="Ideal", 
                                  ymin=lower, ymax=upper), alpha=0.1)
  </code></pre>
  
  <p>Output</p>
  
  <p><a href="https://i.stack.imgur.com/IER04.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/IER04.png" alt="boxplot with rectangle"></a></p>