I would like to add a legend, that only describes the lines in my plot, which is similar to this one:
library(ggplot)
df<-as.data.frame(cbind(seq(1:10), seq(from=2, to=20, 2)))
ggplot(data=df, aes(V1, V2))+geom_point()+
geom_abline(intercept=0, slope=1)
I only want to add the abline to the legend. I already tried to work with geom_line, but it vanishes when I adjust the x and ylims of the plot. ggplot2 does not have the option to build a legend from scratch similar to lattice, does it?
