On Wed, Feb 29, 2012 at 1:56 AM, Jochem Schuster <jochem.schus...@web.de>wrote:
> Hello, > > thank you very much for your answer. In the following, I will provide my > recent code and try to explain again: > > series1 = ts(x$france start=c(2000,1), frequency=4) > series2 = ts(x$germany, start=c(2000,1), frequency=4) > time = c(2000,2001,2002,2003,2004,2005,2006,2007,2008,2009,2010,2011) > ts.plot(series1, series2, col=c("blue", "red"), lwd=3, gpars=list(xaxt="n") > Thank you for an almost reproducible example (we don't have x and you are missing the closing ')' in plot. No worries, the problem is here: > axis(1, at=1:12, tick=1:48, labels=time, las=2) > > # series* is already of class 'ts', so in the plot the x-axis ranges > par('usr')[1:2] and "at=1:12" is out of range. I think you wanted: # x <- matrix(rt(12*4*2,3),nc=2,dimnames=list(NULL,c('france','germany'))) series1 = ts(x[,'france'], start=c(2000,1), frequency=4) series2 = ts(x[,'germany'], start=c(2000,1), frequency=4) ts.plot(series1, series2, col=c("blue", "red"), lwd=3, gpars=list(xaxt="n")) axis(1, at=seq(2000-.25,2012,.25),labels=NA) axis(1, at=2000:2012,labels=2000:2012,tcl= -.8,lwd.ticks=1.2,las=2) Hope that did it. Elai > There is no error with entering these codes. After the ts.plot command, > the x axes in the plot is deleted. > But entering the axis command, the new axes - which should display annual > labels and quarterly ticks - is not plotted. > > Thanks again for your help! > > Jochem > > > > Ihr WEB.DE Postfach immer dabei: die kostenlose WEB.DE Mail App für > iPhone und Android. > *https://produkte.web.de/freemail_mobile_startseite/*<https://produkte.web.de/freemail_mobile_startseite/> > [[alternative HTML version deleted]]
______________________________________________ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.