Well, if you don't want to play with the margins, then I guess you have
to use the layout() function. You will want something similar to the
following if you want legends at the right:

def.par <- par(no.readonly = TRUE)# save default
nf <- layout( matrix( c(1,2), nrow=1), c(4,1) ) # If you want legend at
bottom, change nrow to ncol
layout.show(nf) #  so the ratio of plot to legend area is 4:1

par(mar=c(1,1,1,1))
plot.new()                 # calls an empty plot
legend( 0, 0.5, "A spot", pch=1, col=1)
par(def.par)   # reset to default

There might be a nicer way of doing this though.


-----Original Message-----
From: Jeremy Z Butler [mailto:[EMAIL PROTECTED]] 
Sent: Tuesday, January 21, 2003 11:17 AM
To: [EMAIL PROTECTED]
Subject: [R] key in margin area


Hi
Is there any way to position a key (legend) outside the plot area? i.e.
in 
the margin between plot area and page margin. I realise I could achieve
the 
same effect by creating a larger plot but not printing the axes and then

draw the smaller axes independantly leaving room for the key. However,
that 
wont work very well in my particular case.
Thanks in advance
Jeremy




_________________________________________________________________
Add photos to your e-mail with MSN 8. Get 2 months FREE*.

______________________________________________
[EMAIL PROTECTED] mailing list
http://www.stat.math.ethz.ch/mailman/listinfo/r-help

______________________________________________
[EMAIL PROTECTED] mailing list
http://www.stat.math.ethz.ch/mailman/listinfo/r-help

Reply via email to