Thank you for sharing the references.
I tried as follows.
library(tidyverse)
library(ggfortify)
library(lubridate)
# to data.frame
for_plot <- fortify(fc)
# passing 5 months
for_plot <- for_plot %>%
mutate(Index = ymd(Index) %m+% period("5 month"))
# Plot
ggplot(data = for_plot) +
geom_line(aes(x= Index, y = Data, color = "raw")) +
geom_line(aes(x= Index, y = `Point Forecast`, color = "point forecast")) +
geom_ribbon(aes(x= Index, ymin = `Lo 80`, ymax = `Hi 80`, fill = "80"), alpha = 0.2) +
geom_ribbon(aes(x= Index, ymin = `Lo 95`, ymax = `Hi 95`, fill = "95"), alpha = 0.2) +
scale_fill_manual("what", values = c("blue", "dodgerblue"))+
scale_color_manual("why", values = c("red", "black"))
I want to display the x-axis labels as "2008-12", "2009-06", "2009-12", "..", but displayed as "2009-01", "2009-07", "2010-01", "..".
How should I fix it?