Skip to content

changing the x axis labels in a time series plot

3 messages · Jim Bouldin, Rui Barradas, Hasan Diwan

#
Hello,

Actually, axis() was doing its job, but you have xlim=1:100 and cannot 
expect to see points at x=1322:1421. The correct way would be to say 
that your time series starts at 1322 and that it records observations 
with a frequency of 1. Then plot it. Just look. I've nclude an axis(9 
call to make sure it works as instructed, meaaning, at=Year.


z <- cbind(1:100,100:1); Year = 1322:1421
zz <- ts(z, start=1322, frequency=1)
windows()
plot(zz, plot.type="single", xlab="Year", ylab="zz")
axis(3, at=Year)


Hope this helps,

Rui Barradas

Em 14-07-2012 10:54, Jim Bouldin escreveu: