On 07/12/2011 10:48 PM, Alex van der Spek wrote:
>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?
Hi Alex,
I would use the "xaxt" argument to matplot and then add the axis:
matplot(...,xaxt="n")
timelabels<-format(timestamp,"%H:%M")
axis(1,at=timestamp,labels=timelabels)
Jim
______________________________________________
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.