Another couple of things to think about:

You could use the layout function to set up your multiple plots and
include an extra plotting area at the bottom to place the legend in.

If you stick with the solution below then the cnvrt.coords function from
the TeachingDemos package may be useful (will help you find the
coordinates relative to the last plot).

Hope this helps,

-- 
Gregory (Greg) L. Snow Ph.D.
Statistical Data Center
Intermountain Healthcare
[EMAIL PROTECTED]
(801) 408-8111
 
 

> -----Original Message-----
> From: [EMAIL PROTECTED] 
> [mailto:[EMAIL PROTECTED] On Behalf Of Daniel Brewer
> Sent: Friday, August 10, 2007 4:55 AM
> To: Lauri Nikkinen; r-help@stat.math.ethz.ch
> Subject: Re: [R] Plot legend in margin
> 
> Thanks.  That got me onto the right track.  Because it is a 
> multiplot and I wanted it along the bottom, I found that I 
> had to use par(xpd=NA) and then position it relative to the 
> last of the multiplots.  After a bit of trial and error I got there.
> 
> Thanks
> 
> Lauri Nikkinen wrote:
> > Very simple example:
> >  
> > opar <- par(mar = c(10, 4, 4, 4))
> > plot(1:10)
> > lines(1:10)
> > par(xpd=TRUE)
> > legend(4,-1.5,lty=1, col="black", legend="straigh line")
> > par(opar)
> >  
> > -Lauri
> 
> --
> **************************************************************
> Daniel Brewer, Ph.D.
> Institute of Cancer Research
> Email: [EMAIL PROTECTED]
> **************************************************************
> 
> The Institute of Cancer Research: Royal Cancer Hospital, a 
> charitable Company Limited by Guarantee, Registered in 
> England under Company No. 534147 with its Registered Office 
> at 123 Old Brompton Road, London SW7 3RP.
> 
> This e-mail message is confidential and for use by the\ > ...{{dropped}}

______________________________________________
R-help@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
and provide commented, minimal, self-contained, reproducible code.

Reply via email to