[R] one legend for multiple plots

Uwe Ligges ligges at statistik.uni-dortmund.de
Sun Feb 12 18:52:20 CET 2006


Lucy Crooks wrote:

> Does anyone know how to make one legend above the plots drawn using  
> par(mfrow=c(1,2)), ie in the margin?
> All I've managed is to put a legend inside the plot region of one  
> graph. Although I could write text in the margin I don't know how to  
> draw lines in the margin if I were to construct the legend from scratch.

You can simply use legend, but specify par(xpd=TRUE) before...

Uwe Ligges

> Thanks for any help.
> 
> 
> Lucy Crooks
> Theoretical Biology
> Universitätstrasse 16
> ETH Zentrum, CHN 75.1
> CH-8092 Zurich
> 
> Tel.: 0041 44 632 8326
> Fax: 0041 44 632 1271
> 
> http://www.eco.ethz.ch/
> 
> 
> 	[[alternative HTML version deleted]]
> 
> 
> 
> ------------------------------------------------------------------------
> 
> ______________________________________________
> R-help at stat.math.ethz.ch mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html




More information about the R-help mailing list