Re: [R] Adding lines to xYplot

From: Petr Pikal <petr.pikal_at_precheza.cz>
Date: Tue 30 Jan 2007 - 06:35:50 GMT


Hi

here is another approach based on Gabor Grothendieck's idea to add lines to existing lattice plot.

# based on Gabor Grothendieck's code suggestion # adds straight lines to panels in lattice plots

addLine<- function(...) {
tcL <- trellis.currentLayout()
for(i in 1:nrow(tcL))
  for(j in 1:ncol(tcL))
    if (tcL[i,j] > 0) {

        trellis.focus("panel", j, i, highlight = FALSE)
        panel.abline(...)
        trellis.unfocus()
        }

}

HTH
Petr

On 27 Jan 2007 at 20:13, Michael Kubovy wrote:

To:             	"r-help@stat.math.ethz.ch list" <r-help@stat.math.ethz.ch>
From:           	Michael Kubovy <kubovy@virginia.edu>
Date sent:      	Sat, 27 Jan 2007 20:13:15 -0500
Subject:        	[R] Adding lines to xYplot

> I am using xYplot to plot data and CIs. How do I add several lines to
> the figure? _____________________________ Professor Michael Kubovy
> University of Virginia Department of Psychology USPS: P.O.Box
> 400400 Charlottesville, VA 22904-4400 Parcels: Room 102
> Gilmer Hall
> McCormick Road Charlottesville, VA 22903
> Office: B011 +1-434-982-4729
> Lab: B019 +1-434-982-4751
> Fax: +1-434-982-4766
> WWW: http://www.people.virginia.edu/~mk9y/
>
> ______________________________________________
> R-help@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.

Petr Pikal
petr.pikal@precheza.cz



R-help@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 Tue Jan 30 17:41:09 2007

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.1.8, at Tue 30 Jan 2007 - 07:31:45 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.