Hello,
how is it possible to plot a time series of monthly data over several years
such that the x-axis shows the first letter of the month and displays a grid
line at every year? I am new to R and had no real success until now. I have:
library(utils)
oneMonth = 1.0 / 12.0
tsData = ts(rnorm(103,100), start=2000, deltat=oneMonth) # goes until Jul
2008, real data
plot(tsData, ylab="Values", xlab="Zeit", axes=FALSE)
axis(2) # as is
atX=seq(from=time(tsData)[1], to=time(tsData)[length(tsData)],
by=oneMonth)
labMonths= c("J","F","M","A","M","J","J","A","S","O","N","D")
labX = rep(labMonths, length.out=length(tsData))
axis(1, at=atX, label=labX)