title: Legend with geom_line and geom_ribbon
body: <p>I am creating a figure where I have a line and confidence bands around it. To do this, I am using both <code>geom_line</code> and <code>geom_ribbon</code> in <code>ggplot2</code> in R. The problem is how to deal with the legend. In it, slashes are added and after googling for a quite a while I understand that is a common issue. Most of the solutions I have found are for barplots (e.g. the ggplot cookbook). I have also found solutions to suppress it, but that hasn't worked for me.</p>
  
  <p>Below I have three plots showing the issue. First, when I only plot the line, it looks fine. Then when I add the ribbon part of the plot, the slashes are added. The third plot is how I want it to look (bar the slashes, obviously). How do I achieve this?</p>
  
  <p><img src="https://i.stack.imgur.com/o4ZXd.png" alt="enter image description here"></p>
  
  <p><strong>Edit:</strong> To be clear, what I want is what I have in the following figure (which I fixed using MS Paint):</p>
  
  <p><img src="https://i.stack.imgur.com/kNi10.png" alt="enter image description here"></p>
  
  <pre><code>library(ggplot2)
  library(gridExtra)
  
  set.seed(1)
  y &lt;- sin(seq(1, 2*pi, length.out = 100))
  x &lt;- 1:100
  plotdata &lt;- data.frame(x=x, y=y, lower = (y+runif(100, -1, -0.5)), upper = (y+runif(100, 0.5, 1)))
  h1 &lt;- ggplot(plotdata) + geom_line(aes(y=y, x=x, colour = "sin"))
  h2 &lt;- h1 + geom_ribbon(aes(ymin=lower, ymax=upper, x=x, colour = "bands"), alpha = 0.3)
  h3 &lt;- h2 + scale_colour_manual(name='', values=c("bands" = "grey", "sin" = "blue"))
  
  grid.arrange(h1, h2, h3)
  </code></pre>