Yes, here is one way:

> plot(1:10, pch=1:2)
> par(xpd=NA)
> tmp.u <- par('usr')
> legend(tmp.u[1], tmp.u[4], xjust=0, yjust=0, c('a','b'), pch=1:2)
> 

You will probably want to increase the margins for a real case.  See
?par and the 'xpd' entry for details on the clipping and ?legend for
more details on creating the legend.

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 Edwin Sendjaja
> Sent: Friday, April 11, 2008 1:01 PM
> To: r-help@r-project.org
> Subject: [R] Legend position outside
> 
> Hello,
> 
> Is it possible to get the legend box outside the graphic?
> 
> 
> Kind regards,
> 
> Edwin
> 
> ______________________________________________
> R-help@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.
> 

______________________________________________
R-help@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.

Reply via email to