[R] change layout of legend

Uwe Ligges ligges at statistik.uni-dortmund.de
Sun Dec 9 21:02:12 CET 2001

Stephane Hess wrote:
>    Part 1.1    Type: Plain Text (text/plain)
>            Encoding: quoted-printable

[Manually copied:]

> Is it possible to change the layout of a legend in the 
> plot function for a plot that shows 4 variables, so that 
> the legend shows the variables in a row with 4 elements 
> instead of a column, or to have two columns and two rows 
> in the legend. Also I can't seem to be able to change the 
> size of the font used inside the legend. 
> Any suggestions?

1. Suggestion: Please configure your mailtool.

2. Suggestion: Read the docs for ?legend.

You'll need the following two arguments:

- ncol the number of columns in which to set the legend items 
  (default is 1, a vertical legend). 

- cex character expansion factor relative to current par("cex"). 

 legend(5,5, pch=1:4, legend=LETTERS[1:4], ncol=2, cex=2)

Uwe Ligges
r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !)  To: r-help-request at stat.math.ethz.ch

More information about the R-help mailing list