I agree with Rich that the boxes add to the plot. If one really wants to
eliminate sides of the panel box, perhaps it would improve the graph to use
the between parameter to insert horizontal space between the panels.
Madeline
At 05:27 PM 8/22/2005 -0400, Richard M. Heiberger wrote:
You can get all that you are asking for from trellis.
But it looks bad if you have more than one panel. I will guess
therefore that it is intentionally difficult to turn the box
off. Here are three plots. the first is what you asked for.
The second and third show what happens with two panels.
Neither looks good.
As you can see, these are based on the previous responses to your query.
Rich
y <- c(1:10,1:10*2)
x <- c(rep(1:10,2))
id <- c(rep(1,10), rep(2,10))
trt <- rep(letters[1:2],5)
data <- cbind.data.frame(TIME = x, CONC = y, ID = id, treatment=trt)
par(bty="l") ## get the "L" shaped box
par(oma=c(4,2,2,2)) ## This is to control the outer margin.
xyplot(CONC ~ TIME, data = data,
groups = ID,
scale = list(x = list(draw = F), y = list(draw = F)),
xlab="", ylab="",
panel = function(x,y,subscripts,...) {
panel.superpose(x,y,subscripts,type="b",...)
axis(side=1, at=seq(2,10,2), labels=seq(2,10,2), font=2)
axis(side=2, at=seq(5,20,5), labels=seq(5,20,5), font=3, adj=1)
}
)
## Add x and y labels.
mtext("Time", side = 1, outer = F, font =2, cex = 1.2, line=6)
mtext("CONC", side = 2, outer = F, font =2, cex = 1.2, line=5)
mtext(side=3, "This is how it looks with one panel.", outer=T)
xyplot(CONC ~ TIME | treatment, data = data,
groups = ID,
scale = list(x = list(draw = F), y = list(draw = F)),
xlab="", ylab="",
panel = function(x,y,subscripts,...) {
panel.superpose(x,y,subscripts,type="b",...)
axis(side=1, at=seq(2,10,2), labels=seq(2,10,2), font=2)
axis(side=2, at=seq(5,20,5), labels=seq(5,20,5), font=3, adj=1)
}
)
mtext(side=3, "This looks bad when there is more than one panel.", outer=T)
par(bty="o") ## restore the "O" shaped box
xyplot(CONC ~ TIME | treatment, data = data,
groups = ID,
scale = list(x = list(draw = F), y = list(draw = F)),
xlab="", ylab="",
panel = function(x,y,subscripts,...) {
panel.superpose(x,y,subscripts,type="b",...)
axis(side=1, at=seq(2,10,2), labels=seq(2,10,2), font=2)
axis(side=2, at=seq(5,20,5), labels=seq(5,20,5), font=3, adj=1)
}
)
mtext(side=3, "We now have excess tick labels.", outer=T)
--------------------------------------------------------------------
===
Madeline Bauer, Ph.D. University of Southern California
Keck School of Medicine (Infectious Diseases)
IRD Room 620 (MC9520), 2020 Zonal Ave, Los Angeles 90033
(323) 226-2775 [Voice] (FAX by appointment ;-)
mbauer@usc.edu [Fastest communication method]
|