title: ggplot2: facet_wrap strip color based on variable in data set
body: <p>Is there a way to fill the strips of facets created with facet_wrap based on a variable supplied with the data frame?</p>
  
  <p>Example data:</p>
  
  <p><code>MYdata &lt;- data.frame(fruit = rep(c("apple", "orange", "plum", "banana", "pear", "grape")), farm = rep(c(0,1,3,6,9,12), each=6), weight = rnorm(36, 10000, 2500), size=rep(c("small", "large")))</code></p>
  
  <p>Example plot:</p>
  
  <p><code>p1 = ggplot(data = MYdata, aes(x = farm, y = weight)) + geom_jitter(position = position_jitter(width = 0.3), aes(color = factor(farm)), size = 2.5, alpha = 1) + facet_wrap(~fruit)</code></p>
  
  <p>I know how to change the background color of the strips (e.g. to orange):</p>
  
  <p><code>p1 + theme(strip.background = element_rect(fill="orange"))</code></p>
  
  <p><img src="https://i.stack.imgur.com/pXez8.png" alt="facet_wrap and orange strip color"></p>
  
  <p>Is there a way to pass on the values in the variable <code>size</code> in <code>MYdata</code> to the parameter <code>fill</code> in <code>element_rect</code>?</p>
  
  <p>Basically, instead of 1 color for all strips I would like the strip background color of small fruits (apple, plum, pear) to be green and the background color of large fruits (orange, banana, grape) to be red.</p>