set.seed(007) # for reproducibility
Date1 <- sort(as.Date("2013-09-25")+sample(0:150, 30))
plot(Date1, cumsum(rnorm(30)), type="l", xaxt="n", ann=FALSE)
monthAxis(1)
monthAxis(1, npm=2) # fix number of labels per month
Date2 <- sort(as.Date("2011-07-13")+sample(0:1400, 50))
plot(Date2, cumsum(rnorm(50)), type="l", xaxt="n", ann=FALSE)
monthAxis(1, format="")
monthAxis(1, npy=6) # fix number of labels per year
Date3 <- sort(as.Date("2011-07-13")+sample(0:1200, 50))
plot(Date3, cumsum(rnorm(50)), type="l", xaxt="n", ann=FALSE)
monthAxis(1, n=4, font=2)
monthAxis(1, col.axis=3) # too many labels with default n=5
Run the code above in your browser using DataLab