Dear Rxperts,
How do I hide the top and right axes in multiple panel plots? A couple of
examples are provided below.. Would highly appreciate appreciate your
assistance..

#Example 1
library(latticeExtra)
xyplot((1:200)/20 ~ (1:200)/20, type = c("p", "g"),
scales = list(x = list(log = 2,alternating=0), y = list(log =
10,alternating=0)),
xscale.components = xscale.components.log10ticks,
yscale.components = yscale.components.log10ticks,top=F,right=F)

#Example 2
q <-
 
data.frame(G=rep(paste("G",1:3,sep=""),each=50),D=rep(paste("D",1:5,sep=""),each=30),a=rep(1:15,each=10),t=rep(seq(10),15),b=round(runif(150,10,20)))
q$grp <- paste(q$D,q$a,sep=":")
q$grp <-  ordered(q$grp, levels=unique(q$grp))
q$dcol  <- unlist(sapply(q$D,function(x)
        switch(x,"D1"="orange","D2"="blue","D3"="red", "D4"="seagreen",
"D5"="black")))
q2 <- q[order(q$G,q$D,q$a,q$t),]
xyplot(b~t|G,data=q2,groups=grp,type="l",as.table=T,
    layout=c(3,1), par.strip.text = list(lines = 2),
scales=list(x=list(rela='free',alternating=0),y=list(rela='free',alternating=0),col=1,tck=c(1,0)),
    panel=panel.superpose,
panel.groups=function(x=x,y=y,subscripts=subscripts,groups=groups,...,group.number)
{
        require(grid)
panel.axis(side="top",labels = F,draw.labels = F,ticks = F,line.col=NA,
line.lty=NA,   line.lwd=0, line.alpha=0)
        panel.xyplot(x=x,y=y,subscripts=subscripts,pch=NA,lwd=1,type="l",
                        col=q2$dcol[subscripts],lty=1,cex=0.7)
        },
strip=F,
    #
strip=strip.custom(strip.names=T,strip.levels=T,par.strip.text=list(cex=1.7,font=2),bg=0,
var.name="School"),
        xlab="t",
        ylab="b",
        main="Overlay of Profiles by Schools and Classes",
)


Thanks so much,
Santosh

        [[alternative HTML version deleted]]

______________________________________________
R-help@r-project.org 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.

Reply via email to