I am trying to get a legend for the following ggplot graph but it somehow doesn't work... Any idea how to fix it ? thank you very much!
Returns_ALL %>%
ggplot(aes(x=Date)) +
geom_line(aes(y = SMI), linetype = "solid") +
geom_line(aes(y = PANELB), linetype = "dashed") +
geom_line(aes(y = PANELA), linetype = "longdash") +
scale_x_date(date_breaks="1 month", date_labels = "%b") +
theme_light() +
theme(plot.title=element_text(size=10,hjust = 0.5),axis.text.x=element_text(size=7),
axis.text.y=element_text(size=7),) +
labs(x="",y="") +
geom_vline(xintercept = as.Date(c("2020-03-23","2020-02-19")), linetype = "dotted") +
ggsave("Indexes plot.png")