Skip to content
Back to formatted view

Raw Message

Message-ID: <20020806083215.A13205@camille.indigoindustrial.co.nz>
Date: 2002-08-05T20:32:15Z
From: Jason Turner
Subject: Formatting POSIXt values in plot axis labels
In-Reply-To: <3D4EECBB.89484E33@cornell.edu>; from RML27@cornell.edu on Mon, Aug 05, 2002 at 02:23:07PM -0700

On Mon, Aug 05, 2002 at 02:23:07PM -0700, Ronnen Levinson wrote:
> Hello.
> 
> I have an XYY series that I would like to graph with matplot() or some
> other single function that will do the trick.
> The X in question is a vector of POSIXt values obtained from strptime().
> 
...
> Is there a way for me to give plot() and/or
> matplot() formatting instructions for POSIXt values?
> 

Yup.  In two steps...

1) plot, but without a labeled x-axis (x.stuff should have 
class "POSIXct"):

matplot(x.stuff, y.stuff, xaxt="n")


2) you can now use axis.POSIXct()
And a very nice function it is.  You can tell it where to put
the ticks (if you don't find the defaults appropriate), and what
format to display the dates.

Cheers

Jason
-- 
Indigo Industrial Controls Ltd.
64-21-343-545
jasont at indigoindustrial.co.nz
-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !)  To: r-help-request at stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._