[R] two labels on x-axis (year and month)

mgilgen at swissonline.ch mgilgen at swissonline.ch
Thu Aug 23 06:59:42 CEST 2007


i'm plotting time-series and label the x-axis as follows:

r <- as.POSIXct(round(range(p1$time), "month"))

to define the time range for labeling the xaxis

plot(p1$time,p1$ p1, type="l", xaxt="n")

plots p1 against time

axis.POSIXct(1, at=seq(r[1], r[2], by="month"), format="%m")

labels the axis in mothly steps.

what I want do do now, is a second label for the x-axis, that stands lower and indicates the years.

like 05 06 07 08 09 10 11 12 01 02 03 04 05 etc...
             2004                                  2005
I don't know how to proceed with all the possibilities in axis, par and plot

thanks for your help

More information about the R-help mailing list