0

I was using forecast to make a plot. But, since the forecast line didn't connect with the data line, it was quite hard to see where it end and where it began. I have try this one, but it didn't work. Does anyone have suggestion? Please help

 v1 <- c(2014.4,2014.5,2014.6,2014.7,2014.8,2014.9,2014.10,2014.11,2014.12,2015.1,2015.2,2015.3,2015.4,2015.5,2015.6,2015.7,2015.8,2015.9,2015.10,2015.11,2015.12,2016.1,2016.2,2016.3)

 v2 <- c("2014.4","2014.5","2014.6","2014.7","2014.8","2014.9","2014.10","2014.11","2014.12","2015.1","2015.2","2015.3","2015.4","2015.5","2015.6","2015.7","2015.8","2015.9","2015.10","2015.11","2015.12","2016.1","2016.2","2016.3")

 library(forecast)

 aaa.ts.hw.fc <- forecast.HoltWinters(aaa.ts.hw, h=5)

 plot.forecast(aaa.ts.hw.fc, axis(side = 1, at = v1, labels = v2))

Link to my image : (https://i.stack.imgur.com/Y7C4Q.jpg)

coatless
  • 20,011
  • 13
  • 69
  • 84
GVN.Chaos
  • 23
  • 4
  • what is `aaa.ts`? If you defined a time series you should include that code. It will make it easier to diagnose and fix your problem. – Rick Arko May 12 '16 at 18:42
  • Sorry, aaa is a data frame like just follow Date Total 4/1/2014 35 5/1/2014 53 6/1/2014 218 7/1/2014 277 8/1/2014 270 9/1/2014 93 10/1/2014 388 11/1/2014 268 12/1/2014 244 1/1/2015 431 2/1/2015 338 3/1/2015 453 4/1/2015 450 5/1/2015 513 6/1/2015 556 7/1/2015 501 8/1/2015 519 9/1/2015 455 10/1/2015 511 11/1/2015 489 12/1/2015 513 1/1/2016 479 2/1/2016 857 3/1/2016 1060 aaa.ts <- ts(aaa$Total, frequency=12, start=c(2014,4)) aaa.ts.hw <- HoltWinters(aaa.ts) – GVN.Chaos May 12 '16 at 22:18
  • Sorry but I can't make a line break, and I can no longer edit the previous post – GVN.Chaos May 12 '16 at 22:20
  • Please make your example reproducible using: http://stackoverflow.com/questions/5963269/how-to-make-a-great-r-reproducible-example – coatless May 13 '16 at 13:57
  • Never mind, I got it. If anyone got the same problem, follow here: http://stackoverflow.com/questions/36288009/date-on-the-x-axis-in-holt-winters-graph-r – GVN.Chaos May 18 '16 at 10:52

0 Answers0