Re: [R] xyplot with grid?

From: Gabor Grothendieck <ggrothendieck_at_gmail.com>
Date: Wed, 09 May 2007 15:52:45 -0400

You can do it via panel= or after the fact with trellis.focus...trellis.unfocus. The following illstrates both. The panel= function adds a vertical line at 3 and after the fact we add a vertical line at 6.

pnl <- function(...) {
   panel.abline(v = 3)
   panel.xyplot(...)

}

xyplot(x~y,data.frame(x=1:9,y=1:9,z=sort(rep(c('A','B','C'),3))),

    groups=z,auto.key=list(columns=3), panel = pnl)

trellis.focus("panel", 1, 1)
panel.abline(v = 6)
trellis.unfocus()

On 5/9/07, Gav Wood <news_at_gavofyork.fastmail.fm> wrote:
> Gabor Grothendieck wrote:
> > Add the argument
> >
> > type = c("p", "g")
> >
> > to your xyplot call.
>
> So what's the easiest way to place a line at x=3 (ala "abline(v=3)") to
> the graph? After calling the xyplot call, the panel.* functions seem to
> work only in device coordinates.
>
> Thanks for the help,
>
> Gav
>
> ______________________________________________
> R-help_at_stat.math.ethz.ch mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
>



R-help_at_stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. Received on Wed 09 May 2007 - 19:58:38 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Wed 09 May 2007 - 20:33:27 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.