[R] question on axis labels

Gerard Smits g_smits at verizon.net
Tue Feb 21 00:39:15 CET 2012


Hi All,

I'm trying to label my plot axis with times (HH:MM) that correspond to a numeric index (values 0:6) for my time variable.  I'd like to plot "08:00", "12:00",  and so on, instead of 0 through 6.

I have used the following line of code: 

axis(1, 0:6, labels=c("08:00", "12:00", "16:00", "20:00", "24:00", "04:00", "08:00"), cex=0.8)

[I've used both the 0:6 and at=c(0:6), with no effect.]

My labels come out with a 0 - 6, location dependent, superimposed over my colon in my HH:MM string.  So 08:00 looks like 08000, 12:00 looks like 12100.

Any way of suppressing the at locations?

I'm using version 2.14.0 on a mac

My program pulls in the following packages (not sure relevant):

require (Hmisc)
require (lattice)
require (gplots)


Thanks for any suggestions,

Gerard



More information about the R-help mailing list