[R] Changing Tick Marks for Date Plots

Sean Carmody seancarmody at yahoo.com
Tue Sep 9 15:26:18 CEST 2003


I have been experimenting with various approaches to
plotting (irregular) time-series with reasonable
success. One thing I have been able to do is change
the number of tick marks on the axis. Consider the
following simple example:

> x <- as.data.frame(matrix(ncol=2,nrow=500))
> names(x) <- c("dates","values")
> x$dates <- as.POSIXct(Sys.time()+1:500*86400)
> x$values <- cumsum(rnorm(500))))
> plot(x$dates,x$values,type="l")

The resulting plot only has two tick-marks: 2004 and
2005 (depending on today's date!). I have the same
problem when I use the "its" library:

> library(its)
> plot(as.its(x),format="%b-%Y")

Any suggestions would be greatly appreciated.

Regards,
Sean.



http://search.yahoo.com.au - Yahoo! Search
- Looking for more? Try the new Yahoo! Search




More information about the R-help mailing list