[R] specify size of box around legend

Rainer M Krug Rainer at krugs.de
Fri Mar 11 15:01:56 CET 2016


assume the following code:

--8<---------------cut here---------------start------------->8---
legend(x="topleft", legend = LETTERS[1:10], title = "L 1")
legend(x="bottomleft", legend = paste(LETTERS[1:10], letters[1:12],LETTERS[1:10]), title = "L 2")
legend(x="topright", legend = LETTERS[1:15], title = "L 3")
--8<---------------cut here---------------end--------------->8---

The box around L 1 is less wide than the box around L 2 due to automatic
sizing of the box.

Is there a way of specifying the width of the box, so that L 1 and L 2
have the same width?

In the same sense: can I also specify the height of the legend, so that
L 1 and L 3 have the same height?


Rainer M. Krug
email: Rainer<at>krugs<dot>de
PGP: 0x0F52F982
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 454 bytes
Desc: not available
URL: <https://stat.ethz.ch/pipermail/r-help/attachments/20160311/9314fa85/attachment.bin>

More information about the R-help mailing list