From: <rhelp.20.trevva_at_spamgourmet.com>

Date: Mon, 18 Feb 2008 10:53:54 +0100

plot(x,y,xaxt="n",xlim=c(0,1),xlab="",pch=1,col="red") plot(y,z,xlim=c(0,1),pch=2,col="blue")

R-help_at_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. Received on Mon 18 Feb 2008 - 11:23:43 GMT

Date: Mon, 18 Feb 2008 10:53:54 +0100

Suggestions and insights most welcome! Code follows at the bottom.

graphics.off()

#First set number of plots

par(mfrow=c(2,1))

#Generate the legend once to get the height

leg <- legend("bottom",legend=c("Item A","Item B"),horiz=TRUE,pch=c(1,2),

col=c("red","blue"),plot=FALSE,trace=TRUE)

par(oma=c(5,4,4,2)+0.1,mar=c(0,0,0,0),xpd=NA)

#Add space at the bottom for the legend

bottom.spacing <- par("omi") + c(leg$rect$h,0,0,0)
par(omi=bottom.spacing)

x <- runif(100) y <- runif(100) z <- rnorm(100)

plot(x,y,xaxt="n",xlim=c(0,1),xlab="",pch=1,col="red") plot(y,z,xlim=c(0,1),pch=2,col="blue")

col=c("red","blue"),inset=c(0,-0.475))

R-help_at_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. Received on Mon 18 Feb 2008 - 11:23:43 GMT

Archive maintained by Robert King, hosted by
the discipline of
statistics at the
University of Newcastle,
Australia.

Archive generated by hypermail 2.2.0, at Mon 18 Feb 2008 - 12:30:14 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.
*