I have this graphic
Month2 <- c("Oct 20", "Nov 20", "Dec 20", "Dec 20", "Jan 21", "Feb 21", "Mar 21", "Apr 21", "May 21", "Jun 21")
Forcast_data <- data.frame(
"Month" = c("Oct 20", "Nov 20", "Dec 20", "Dec 20" ,"Jan 21", "Feb 21", "Mar 21", "Apr 21", "May 21", "Jun 21"),
"Value" = c(68,47,55, 55, 105, 95,75, 65,60,105),
"Type" = c("Actual", "Actual", "Actual", "Forecast", "Forecast","Forecast","Forecast","Forecast","Forecast","Forecast")
)
ggplot(Forcast_data, aes(Month2,Value, color=factor(Type))) +
geom_line(aes(group = 1)) +
geom_point() +
scale_x_discrete(limits = Month2) +
scale_color_manual(values = c("dodgerblue", "orange")) +
scale_size_manual(values = c(1, 2)) +
labs(x = "Month") + theme(legend.title = element_blank()) + theme_minimal())
My Goal is to add a dashed line between "Dec 20" and "Jan 21" to indicate its a new year.
I just can't figure out how to manually set my xintercept. Also, the reason I have both a actual & forecast for Dec 20 is because I'm wrapping this graphic in a plotly() and it breaks the lines apart if I don't do it like this. I'm not sure if there is another solution for that.