title: ggplot single generic legend entry for grouped ribbons
body: <p>Using ggplot in R, I'm plotting several grouped lines with an associated interval ribbon around each line. I'd like to split the legend into two parts: one associating each color with the appropriate group, the other explaining the geom elements themselves (a black point/line labeled &quot;Medians&quot;, and a generic grey area labeled with &quot;Range&quot;). From reading some other questions I'm guessing the right way to do this is via some dummy aesthetic mapping, but I'm stuck on how to actually implement that to get what I want.</p>
  <p>Here's some example data:</p>
  <pre><code># Create generic data
  test_data &lt;- data.frame(label=rep(c(&quot;A&quot;, &quot;B&quot;, &quot;C&quot;), each=10),
                          x=rep(1:10, 3),
                          y0=c(1 + runif(10), 4 + runif(10), 7 + runif(10)/2),
                          y1=c(2 + runif(10), 5 + runif(10), 7.5 + runif(10)/2),
                          y2=c(3 + runif(10), 6 + runif(10), 8 + runif(10)/2)
  )
  
  # and plot
  ggplot(test_data, aes(x=x, y=y1, ymin=y0, ymax=y2, group=label, color=label, fill=label)) + 
    geom_line() + geom_point() + geom_ribbon(alpha=0.25)
  
  
  </code></pre>
  <p>Current output</p>
  <p><a href="https://i.stack.imgur.com/NRnte.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/NRnte.png" alt="Three colored lines with corresponding ribbons, and a legend that groups them all together" /></a></p>
  <p>And a mockup of what I'm after:</p>
  <p><a href="https://i.stack.imgur.com/B7vPs.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/B7vPs.png" alt="enter image description here" /></a></p>