I have the following plot:
The code I used to generate this plot was:
ggplot(df, aes(x = instance, y = total_hits))+
geom_point(size = 1)+
geom_line()+
geom_line(aes(x=df$instance, y = line1), colour="red")+
geom_vline(xintercept=805) +
geom_line(aes(x=df$instance, y = line2), colour="blue")+
geom_line(aes(x=df$instance, y = line3), colour="purple")
I would like to add a legend to this plot, to label each line. However, since I added each line manually, I am not sure how to add the legend. Any tips/advice?
- I cannot share the data I am using, so I am just looking for a general way to add legends manually.