Skip to content

plotting time series with zoo pckg

2 messages · AA, Gabor Grothendieck

AA
#
Dear Gabor,
Thank you for your quick reply.
This solution works for my univariate zoo class time series. I first tried
it for a timeseries with 4 columns of data, it did not plot the labels nor the
ticks, I tried it on a one dim timeseries (one column zoo class data as the example 
in the question) and it worked!  is there something that I am missing?
Thanks again.
AA.


----- Original Message ----
From: Gabor Grothendieck <ggrothendieck at gmail.com>
To: ahmad ajakh <aajakh at yahoo.com>
Cc: r-help at stat.math.ethz.ch
Sent: Tuesday, December 26, 2006 8:31:07 PM
Subject: Re: [R] plotting time series with zoo pckg

Try this:


# test data
library(zoo)
z <- structure(c(21, 34, 33, 41, 39, 38, 37, 28, 33, 40),
     index = structure(c(8044, 8051, 8058, 8065, 8072, 8079, 8086,
     8093, 8100, 8107), class = "Date"), class = "zoo")
z

# plot without X axis
plot(z, xaxt = "n")

# unlabelled tick at each point
axis(1, time(z), lab = FALSE)

# labelled tick every third point
dd <- time(z)[seq(1, length(z), 3)]
axis(1, dd, as.character(dd), cex.axis = 0.7, tcl = -0.7)
On 12/26/06, ahmad ajakh <aajakh at yahoo.com> wrote:
#
Please read the last line of every message to r-help and follow that.
On 12/26/06, ahmad ajakh <aajakh at yahoo.com> wrote: