[R] panel function with zoo

stephen sefick ssefick at gmail.com
Tue Aug 19 21:13:23 CEST 2008


n <-  c("m", "j", "j", "a", "s", "o", "n", "d", "j", "f", "m", "a",
"m", "j", "j", "a","s", "o", "n", "d", "j")
pnl.xaxis <- function(...) {
    lines(...)
    panel.number <- parent.frame()$panel.number
    nser <- parent.frame()$nser
    # if bottom panel
    if (!length(panel.number) || panel.number == nser) {
    rng <- range(time(y.zoo))
	 axis(1, at = seq(rng[1], rng[2], 1/12), labels = n, tcl = -0.3)
     }
}
plot(y.zoo[,5:9],  panel=pnl.xaxis, type="b", main="215", ylab=names, xaxt="n")

I know this is not reproducible, but this does exactly what I want
except that it only labels the second column of graphs x-axis.  There
are two columns of graphs three in the, first stacked on top of each
other, and two in the second, stacked on top of each other.  Am I
missing something simple?

thanks

Stephen Sefick

-- 
Let's not spend our time and resources thinking about things that are
so little or so large that all they really do for us is puff us up and
make us feel like gods. We are mammals, and have not exhausted the
annoying little problems of being mammals.

	-K. Mullis



More information about the R-help mailing list