title: Show only specific lines and an area in one legend with ggplot2
body: <p>I have a question concerning a certain plot. Consider I have the following data.frame:</p>
  
  <pre><code>data &lt;- data.frame(a = c(44, 58, 60, 63, 65, 66, 67, 68, 69, 70), 
                 b = c(38, 52, 55, 57, 59, 60, 61, 62, 63, 65),
                 c = c(51, 64, 66, 68, 70, 71, 71, 73, 74, 75),
                 d = c(44, 53, 54, 55, 56, 56, 58, 59, 59, 60),
                 e = c(44, 57, 59, 60, 62, 63, 64, 65, 66, 67),
                 x = c(1, 2, 3, 4, 5, 6, 7, 8, 9, 10))
  rownames(data) = c('A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J')
  </code></pre>
  
  <p>I want to plot the three polygons (x,a), (x,d), (x,e) with the three different linetypes 'solid', 'dotdash' and 'dash'. They should all appear in the legend. Besides I want to plot the polygons (x,b), (x,c) with linetype 'dotted' and color the are between them red. Only the red area should be displayed in the legend but not the dotted lines themselves. To do so I wrote the following code lines:</p>
  
  <pre><code>data_no_legend = data[,c(2,3,6)]
  data_legend = data[,c(1,4,5,6)]
  
  data_melt_legend = melt(data_legend, id = "x")
  data_melt_no_legend = melt(data_no_legend, id = "x")
  
  p &lt;- ggplot()
  p &lt;- p + geom_ribbon(data = data, aes(x = x, ymin = b, ymax = c,fill = 'legend'), alpha = 0.5, show.legend = TRUE, inherit.aes = FALSE)
  p &lt;- p + scale_fill_manual(labels = c("legend"), values = c('red'))
  p &lt;- p + geom_line(data = data_melt_legend, aes(x = x, y = value,    size = variable, linetype= variable), color = 'gray', show.legend = TRUE,  inherit.aes=FALSE)
  p &lt;- p + scale_linetype_manual(labels = c("legend 1","legend 2", "legend 3"),values = c("solid","dashed", "dotdash"))
  p &lt;- p + scale_size_manual(labels = c("legend 1","legend 2", "legend 3"),values = c(1,0.5,0.5))
  p &lt;- p + geom_line(data = data_melt_no_legend, aes(x = x, y = value,  group= variable), color= 'gray', linetype = 'dotted', show.legend = FALSE,  inherit.aes=FALSE)
  p &lt;- p + geom_point(data=data, aes(x = x, y = a), color = 'gray',  size = 1.5,inherit.aes=FALSE)
  </code></pre>
  
  <p>Unfortunately I have two different legends. One for the lines and one for the area. Can anyone help me out? Thank you!</p>