Skip to content
Prev 30986 / 63424 Next

legend() in a multiple figure environment

On 1/8/2009 9:29 AM, Simone Giannerini wrote:
I think the only advice here is "don't do that".  The problem is that 
the box is sized appropriately to surround the text when it is first 
drawn, then you scale everything up except the text, so the box becomes 
too big.  The new box is appropriate to the text at the new size.

Then you scale everything again when you save to a file, and the boxes 
end up different again.

So the advice is:   draw legends with the plot at its final size if you 
want the sizing to work properly.  R doesn't save the fact that the size 
is supposed to be relative to the text, rather than relative to the plot 
region.

Duncan Murdoch