I'm having problems adding a legend to this ggplot2 plot
ggplot(PeriodNaive2, aes(x=log(V2), y=log(V1))) +
geom_line(data = PeriodNaive2, color = "red", size = 1.35) +
geom_line(data = PeriodSmart2, color = "steelblue", size = 1.35)+labs(x = "" , y="")+
theme(panel.background = element_rect(fill = "white", color = "black", size = 0),panel.grid = element_line(color="grey"))
I wanted to add a simple legend on the right side stating that the red graph is "PeriodNaive" and the blue one is "PeriodSmart".
I tried using "color=Legend" in the aes part of geom_line and using many other methods but it just won't work
thanks to anyone in advance for the help