[R] ts.plot and x axes customization

Jochem Schuster jochem.schuster at web.de
Tue Feb 28 20:57:55 CET 2012

   Dear List,
   I would be pleased if someone can help me with the following issue:
   I'm about to plot two time series in one plot via ts.plot which looks like:
   ts.plot(series1, series2, main=main, xlab=xlab, ylab=ylab, col=c("green",
   "red", "blue"), lwd=2)
   The  problem  is,  that  R  automatically  sets  the  x axes labels in
   5-year-intervalls. Every 5 years there's one tick and one label with the
   respective year. Now I would like to customize the axes in a way that there
   is a label every year and a tick every quarter.
   In the previous code I've determined the time series with
   series1 = ts(x, start=c(2000,1), frequency=4)
   series2 = ts(y, start=c(2000,1), frequency=4)
   What I've tried before is deleting the X axes via gpars=list(xaxt="n") in
   the ts.plot-code. But after that I was not aible to add the customized axes
   via axis()...
   In advance, thank you very much for your help and hints!

   Ihr WEB.DE Postfach immer dabei: die kostenlose WEB.DE Mail App für iPhone
   und Android.


   1. https://produkte.web.de/freemail_mobile_startseite/

More information about the R-help mailing list