Skip to content

How to add grid to plot.zoo easily

2 messages · Wind, Gabor Grothendieck

#
Sorry for suppling codes not reproducible.
I think you have taught me enough on this issue:
1.  it is the fact that grid in R does not automatically align with Date and that is independent of zoo.
2.  there is vignette("zoo-faq"), besides vignette("zoo").
3.  FAQ #8 is very useful for me.
Thanks Gabor.

Winds 

 
------------------ Original ------------------
From:  "Gabor Grothendieck"<ggrothendieck at gmail.com>;
Date:  Sun, Jan 11, 2009 10:20 PM
To:  "Wind"<windspeedo at qq.com>; 
Cc:  "r-sig-finance"<r-sig-finance at stat.math.ethz.ch>; 
Subject:  Re: [R-SIG-Finance] How to add grid to plot.zoo easily

 
That's not reproducible:
Loading required package: RODBC
Error: could not find function "getSymbol.RE"

however, I suspect you are referring to the fact that
grid in R does not automatically align with Date and
that is independent of zoo.  The following misaligned
plot does not use zoo:

plot(Sys.Date() + 1:100, 1:100, pch = 20)
grid()

Tested in R version 2.8.1 Patched (2008-12-26 r47350)

Its not clear here whether or not you are really
using zoo but if you are then see the first example
in the answer to zoo FAQ #8 "How are axes
added to a plot created using plot.zoo?" and follow
that code by the following line which does align the grid
properly:

abline(v = m, col = grey(0.8), lty = 2)

The zoo FAQ is available via: vignette("zoo-faq")
On Sun, Jan 11, 2009 at 6:17 AM, Wind <windspeedo at qq.com> wrote:
#
On Sun, Jan 11, 2009 at 9:28 AM, Wind <windspeedo at qq.com> wrote:
There are actually three zoo vignettes in total.  library(help = zoo)
lists them at the bottom.