[R] using more plotting area for a lattice plot

Juliet Hannah juliet.hannah at gmail.com
Fri Apr 10 20:23:03 CEST 2009


Hi Group,

For the plot below, are there other ways I can use more of the
plotting space. I've tweaked the parameters I know of.
I could also put the plot titles inside the plot if there is a way to
do that.  Thanks for your input. Regards, Juliet

p1 <- runif(1000) # sample data
qp1 <- qqmath(~ -log(p1), data = as.data.frame(p1), distribution =
qexp,main="A",xlab="",ylab="")
qp2 <- qqmath(~ -log(p1), data = as.data.frame(p1), distribution =
qexp,main="B",xlab="",ylab="")
qp3 <- qqmath(~ -log(p1), data = as.data.frame(p1), distribution =
qexp,main="C",xlab="",ylab="")
qp4 <- qqmath(~ -log(p1), data = as.data.frame(p1), distribution =
qexp,main="D",xlab="",ylab="")

png(file="myplots.png", height=500,width=500)
trellis.par.set(list(layout.heights = list(top.padding =
0,main.key.padding=0,key.axis.padding=0,
                                          axis.xlab.padding=0,
xlab.key.padding=0,key.sub.padding=0,bottom.padding=0),
                     layout.widths =
list(left.padding=0,key.ylab.padding=0,ylab.axis.padding=0,axis.key.padding=0,right.padding=0)))
plot(qp1, split = c(1, 1, 2, 2), more = TRUE)
plot(qp2, split = c(1, 2, 2, 2), more = TRUE)
plot(qp3, split = c(2, 1, 2, 2), more = TRUE)
plot(qp4, split = c(2, 2, 2, 2), more = FALSE)
dev.off()




More information about the R-help mailing list