Togaware DATA MINING
Desktop Survival Guide
by Graham Williams
Google

Plot Time Series with Axis Labels

With the same data as previously, here we control the axis labels. We tell the plot not to include axes (xaxt="n"). Then we add days to the x axis, and then we add tick marks for the hours within the day.

[width=0.8]rplot-time-basic-labels


plot(zobs, plot.type="single", xaxt="n")
days <- seq(min(floor(datetimes)), max(floor(datetimes)))
axis(1, days, format(as.Date(days), "%b %d"), tcl=-0.6)
hours <- seq(min(datetimes), max(datetimes), by=1/24)
axis(1, hours, FALSE, tcl=-0.4)

http://rattle.togaware.com/code/rplot-time-basic-labels.R



Copyright © 2004-2006 Graham.Williams@togaware.com
Support further development through the purchase of the PDF version of the book.
Brought to you by Togaware.