monthLabs(2014,2014, 3) # 3 days per month
monthLabs(2013,2014, npy=3) # 3 months per year, equally spaced
monthLabs(2014,2014, npy=4) # 4 months per year
as.Date("2013-09-25")
# Find out why as.Date("2013-09-25") does not pass check
Date <- sort(as.Date("2013-09-25")+sample(0:150, 30))
plot(Date, cumsum(rnorm(30)), type="o", xaxt="n", ann=FALSE)
axis(1, monthLabs(npm=1), format(monthLabs(npm=1), "%d.%m.\n %Y"),
mgp=c(3,2,0), cex.axis=0.7 )
Date <- sort(as.Date("2011-07-13")+sample(0:400, 50))
plot(Date, cumsum(rnorm(50)), type="o", xaxt="n", ann=FALSE)
axis(1, monthLabs(npy=6), format(monthLabs(npy=6), "%d.%m.\n%Y"),
mgp=c(3,2,0), cex.axis=0.7 )
Run the code above in your browser using DataLab