s-news
[Top] [All Lists]

panel.superpose

To: s-news@lists.biostat.wustl.edu
Subject: panel.superpose
From: "Robert M. Key" <key@Princeton.EDU>
Date: Tue, 20 Feb 2001 11:19:59 -0500
Organization: Atmos. and Ocean Sci. Program
Version 3.4 Release 1 for Sun SPARC, SunOS 5.3 : 1996 

I'm a bit confused here. The following is supposed to make a three panel
plot segregated by "Latfac". Within each subplot, the points should be
colored using "Zfac". Finally, I need to add a line to each subplot.

Latfac is a factor with three unique elements
Zfac is a factor with 4 unique elements

Without the final line, the following works (bells and whistles removed
here):

xyplot(c14~silicate|Latfac,data=junkdf,
        layout=c(3,1),
        groups=Zfac,
        pch=superpose.symbol$pch[1:4],
        col=superpose.symbol$col,
        cex=superpose.symbol$cex,
        panel=panel.superpose)

The only way I know to add the line is via a panel function, so I tried
the following (and variations). The points are segregated into each
subplot correctly, but the colors are clearly incorrect. Apparently, I
have a problem with either groups or subscripts, but what???

xyplot(c14~silicate|Latfac,data=junkdf,
        layout=c(3,1),
        panel=function(x,y,...){
                panel.superpose(x,y,groups=Zfac,subscripts=T,
                        col=superpose.symbol$col,
                        pch=superpose.symbol$pch[1:4],
                        cex=superpose.symbol$cex)
                abline(-70,-1,lwd=2)
                })

Alternately, is there a way to add the line to the first example without
resorting to the panel function?? Adding Zfac outside the panel function 
makes no difference.

thanks for the help,
bob

<Prev in Thread] Current Thread [Next in Thread>
  • panel.superpose, Robert M. Key <=