Hello. I am using R version 2.1.1 on Windows 2000.

I am using a par(mfrow=c(2,2)) statement to produce 4 plots on one screen. I want a single horizontal legend to appear at the top of the four plots. My code is something like this:

par(mfrow=c(2,2))

plot(x,y1)
lines(x,y2)
lines(x,y3)

plot(x,z1)
lines(x,z2)
lines(x,z3)

plot(x,t1)
lines(x,t2)
lines(x,t3)

plot(x,w1)
lines(x,w2)
lines(x,w3)

Instead of the statement:
legend(x="right", c("Bias Squared","Variance","Mean Squared Error"), lty=c(2,1,3), col=c("green","blue","red"), lwd="2",cex=0.5,inset = 0.05)

appearing within each plot, I would like it to appear at the top of the graph because it applies to all four plots. Any help would be appreciated. Thank you.

-Juned
	[[alternative HTML version deleted]]


