Skip to content
Back to formatted view

Raw Message

Message-ID: <Pine.LNX.4.44.0306261412080.1335-100000@gannet.stats>
Date: 2003-06-26T13:15:01Z
From: Brian Ripley
Subject: Plots using POSIX
In-Reply-To: <2F3262756375D411B0CC00B0D049775DFD61EC@westpark.tanox.net>

On Thu, 26 Jun 2003, Shawn Way wrote:

> Is there a reason that the bottom axis changes color when POSIX data is used
> in plot function?

It's not the same plot function, that's why.

> For example:
> 
> > timedata <- c("2/3/2003","3/4/2003","5/4/2003")
> > timedata2 <- strptime(timedata,format="%m/%d/%Y")
> > numdata <- c(2,3,4)
> > plot(as.POSIXct(timedata2),numdata,col="red",type="o")
> 
> As compared to:
> 
> > numdata2 <- c(3,4,5)
> > plot(numdata2,numdata,col="red",type="o")
> 
> I assume that the work around is to place the box and axis after the plot is
> created, correct?

Or the lines after the plot is created.

> plot(as.POSIXct(timedata2),numdata,type="n")
> lines(as.POSIXct(timedata2),numdata,col="blue",type="o")

-- 
Brian D. Ripley,                  ripley at stats.ox.ac.uk
Professor of Applied Statistics,  http://www.stats.ox.ac.uk/~ripley/
University of Oxford,             Tel:  +44 1865 272861 (self)
1 South Parks Road,                     +44 1865 272866 (PA)
Oxford OX1 3TG, UK                Fax:  +44 1865 272595