plot - How to show date labels on the X-axis for the forecasted values in R? -


we have used forecast function forecast future values follows:

library("zoo") library("forecast") lines = "20/03/2014,9996792524 21/04/2014,8479115468 21/09/2014,11394750532 16/10/2014,9594869828 18/11/2014,10850291677 08/12/2014,10475635302 22/01/2015,10116010939 26/02/2015,11206949341 20/03/2015,11975140317 09/04/2015,11526960332 29/04/2015,9986194500 16/09/2015,11501088256 13/10/2015,11833183163 10/11/2015,13246940910 16/12/2015,13255698568 27/01/2016,13775653990 23/02/2016,13567323648 22/03/2016,14607415705 11/04/2016,13835444224 04/04/2016,14118970743" z <- read.zoo(text = lines, sep = ",", header = true, index = 1:1, tz = "", format = "%d/%m/%y") x <- ts(z,f=4) fit <- ts(rowsums(tssmooth(structts(x))[,-2])) tsp(fit) <- tsp(x) plot(x) lines(fit,col=2) fit fcst <- forecast(fit) plot(fcst) 

however, plot fcst not show time/date labels on x-axis , instead shows generic numbers 1,2,3...

enter image description here

to understand forecasted values, need monthly date labels on x-axis. how can this?


Comments