title: ggplot2 - combining geom_bar and geom_line legend
body: <p>I can't seem to get my geom_bar and geom_line legends combined.  I know there are several discussions on this subject and I think I have tried most of the suggestions without success, but I don't think I understand the problem.  As I've spent a few hours on this and not made any progress I thought it time to ask the experts. Thanks for any help!</p>
  
  <p>My data:</p>
  
  <pre><code>A &lt;-data.frame("X"= 1:6, "New" = c(5,25,10,43,2,3), "Recaptured" = c(0,2,20,20,29,14), "Cumulative" = c(5,30,40,83,85,88))
  </code></pre>
  
  <p>My code:</p>
  
  <pre><code>A$X&lt;-factor(A$X, levels=A$X)
  A[A==0]&lt;-NA
  p1&lt;-A %&gt;%
    gather(key,value,New,Recaptured) %&gt;%
    ggplot(aes(x=X, y=value, fill=key,  color="Cumulative"))+
    geom_line(aes(y=Cumulative,group=1), size=1.25)+
    geom_bar(stat="identity", width = 0.4, position = position_dodge(), color="black")+
    scale_fill_grey(start = 0, end = 0.9)+
    xlab(NULL)+
    ylab(NULL)+
    ggtitle("none")+
    theme_minimal()+
    theme(axis.title.x = element_text(size = 12, hjust = 0.35))+
    theme(plot.title = element_text(hjust = 0.5)) +
    #theme(plot.margin = margin(t=4,1,1,1, "lines"))+
    theme(legend.direction="horizontal") +
    theme(legend.position = c(.25, 0.9))+
    theme(legend.background = element_rect(fill = "white", linetype = "solid", color="black"))+
    theme(legend.title = element_blank())
  p1
  </code></pre>
  
  <p>Current plot:
  <a href="https://i.stack.imgur.com/UBaoc.png" rel="nofollow noreferrer">enter image description here</a></p>
  
  <p><a href="https://i.stack.imgur.com/UBaoc.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/UBaoc.png" alt="enter image description here"></a></p>