[R] matplot with dates/times on horizontal axis

Alex van der Spek doorz at xs4all.nl
Tue Jul 12 14:48:12 CEST 2011


 >matplot(timestamp,xymatrix,type='l')

where timestamp is a vector filled with POSIXct objects and xymatrix is 
a numeric 2x2 matrix plots but the horizontal axis labels are raw 
unformatted timestamps.

I would like to format these in any of the available codes for strftime, 
for instance format="%H:%M".

Passing a vector of formatted strings does not work. Any obvious other 
ways fail upon me as well.

Any ideas to make this work?

Thanks in advance,
Alex van der Spek



More information about the R-help mailing list