I have a problem adding geom_vline legends when I already have very well defined geom_line legends my code is as follows:
g1=ggplot(M7, aes(x =CODT, y =TNA, group =Tre7))
g1=g1+geom_line(aes(color=Tre7, linetype=Tre7), size=0.8)
g1=g1+scale_color_manual(values=c("#7FCCE7", "#DC693F"), name ="Groups", breaks=c("0", "1"),labels=c("Control", "Treated"))
g1=g1+scale_linetype_manual(values=c("solid", "dotdash"), name ="Groups", breaks=c("0", "1"),labels=c("Control", "Treated"))
g1=g1+geom_vline(xintercept=122,linetype="solid", size=1, color="#9B9FA1")
g1=g1+labs(x="Time Period", y="Births by 1000 people")
g1=g1+ggtitle("Mean of Birth Rates for Treated and Control")+scale_x_continuous(breaks=c(0,24,48,72,96,120,144,168,192), labels=c(2000, 2002, 2004, 2006, 2008, 2010, 2012, 2014, 2016))+theme_economist_white()
g1
As a Result I get:
Where CODT id the time period en Tre7 is a dummy variable for treated and controls, TNA is BirthRates of this two groups.
My question is how can I get a nice legend for geom_vline with the label "27F" that does not interfere with geom_line legends? I have tried with show.legend=TRUE and Show_guide=TRUE but nothing is working.