title: Add vline to existing plot and have it appear in ggplot2 legend?
body: <p>I have some data that I am using to plot a histogram. I also have two sets of thresholds that have some significance.</p>
  
  <p>I am able to plot the histogram and the vlines with the appropriate styles. However, I cannot get my vlines to show up in the legend. I believe that something like this should work, however the legend items don't ever display.</p>
  
  <pre><code>df &lt;- data.frame(val=rnorm(300, 75, 10))
  
  cuts1 &lt;- c(43, 70, 90)
  cuts2 &lt;- c(46, 79, 86)
  
  ggplot(data=df, aes(x=val)) +
    geom_histogram() +
    geom_vline(xintercept=cuts1,
               linetype=1,
               color="red",
               labels="Thresholds A",
               show_guide=TRUE) +
    geom_vline(xintercept=cuts2,
               linetype=2,
               color="green",
               labels="Thresholds B",
               show_guide=TRUE)
  </code></pre>
  
  <p>Alternatively, if I construct a data.frame for my cuts and do an aesthetic mapping, I can get my vlines to show up in the legend. Unfortunately, the legend gives me two instances of the different line types superimposed on each other:</p>
  
  <pre><code>cuts1 &lt;- data.frame(Thresholds="Thresholds A", vals=c(43, 70, 90))
  cuts2 &lt;- data.frame(Thresholds="Thresholds B", vals=cuts2 &lt;- c(46, 79, 86))
  
  ggplot(data=df, aes(x=val)) +
    geom_histogram() +
    geom_vline(data=cuts1, aes(xintercept=vals, shape=Thresholds),
               linetype=1,
               color="red",
               labels="Thresholds A",
               show_guide=TRUE) +
    geom_vline(data=cuts2, aes(xintercept=vals, shape=Thresholds),
               linetype=2,
               color="green",
               labels="Thresholds B",
               show_guide=TRUE)
  </code></pre>
  
  <p><img src="https://i.stack.imgur.com/3pFHc.png" alt="enter image description here"></p>
  
  <p>So, in the end, what I'm looking for, is the most straightforward way to manually add two sets of lines to a plot, and then have them appear correctly in the legend.</p>