[R] Legend outside plot box?

Ben Tupper PemaquidRiver at tidewater.net
Sun Mar 1 21:31:28 CET 2009


On Mar 1, 2009, at 2:45 PM, Gregory Propf wrote:

> I'm trying to put the legend in my matplot plot outside the plot  
> box and it just doesn't seem to want me to.  If I use a negative  
> value for "inset" I just see only the part of the legend that is  
> inside the plot box.  Any ideas? - Greg
>
>

Hi,

You can control clipping with the xpd parameter to par...

matplot(1:10,1:10)
par(xpd=NA)
legend(0,12,"sailing is fun")

xpd can take on other values, too.

Cheers,
Ben




More information about the R-help mailing list