[R] Question about multiple plots of zoo objects
sergeyg at gmail.com
Tue Mar 3 14:37:19 CET 2009
No, what I am trying to do is similar to:
where spread is the multivariate zoo object (say, 5 timeseries).
That is, I want to color parts of the plots where indicator==(-1), but
do the coloring
without using layout() and then repeating plot() and abline() for each
of the 5 timeseries.
On Tue, Mar 3, 2009 at 14:22, Gabor Grothendieck
<ggrothendieck at gmail.com> wrote:
> Are you trying to color the points themselves? This plots the
> first two series in frame 1 (they are the same but one is plotted
> as points and the other as a line) and the third series is shown
> in frame 2 and for the series of points it colors them green or red.
> The lines are all colored black:
> x <- zoo(rnorm(10))
> s <- sign(x)
> plot(cbind(x, x, s), screen = c(1, 1, 2), type = c("p", "l", "l"),
> col = list(ifelse(s > 0, "green", "red"), 1, 1), pch = 20)
> On Tue, Mar 3, 2009 at 7:48 AM, Sergey Goriatchev <sergeyg at gmail.com> wrote:
>> Hello, everyone
>> I have a zoo object containing several time series of daily frequency.
>> One of these timeseries is an indicator function with value (-1) at
>> certain times, and (+1) at the other.
>> I do a plot of several of the timeseries in one go (a multiple plot).
>> I wonder if I can automatically in EACH plot color the area where
>> indicator variable is (-1)?
>> Of course, I could do it simply with layout() and then for each
>> timeseries do plot and a color overlay, but I wonder if with
>> plot.zoo() simething similar is possible to do automatically.
>> Thanks in advance for help!
>> R-help at r-project.org mailing list
>> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
>> and provide commented, minimal, self-contained, reproducible code.
I'm not young enough to know everything. /Oscar Wilde
Experience is one thing you can't get for nothing. /Oscar Wilde
When you are finished changing, you're finished. /Benjamin Franklin
Tell me and I forget, teach me and I remember, involve me and I learn.
Luck is where preparation meets opportunity. /George Patten
More information about the R-help