[R] Legend Text Font Size

Uwe Ligges ligges at statistik.tu-dortmund.de
Tue Feb 16 20:24:36 CET 2010



On 16.02.2010 19:59, Rob Helpert wrote:
> Hi.
>
> I have a plot containing a large number of lines.  I have placed a
> legend in the plot, but with so many lines, the legend takes up a lot
> of space.  I have tried to reduce the spacing between the lines using
> the legend parameter x.intersp=0.7, but this does not compress the
> legend enough.  Is there some way to make the text font size smaller
> in "legend"?


Use argument cex, as usual in plot functions:

plot(1)
legend(1,1,legend="a very long text - some very small font size", pch=1, 
cex=0.5)

Uwe Ligges

> Thanks,
> RH.
>
> ______________________________________________
> R-help at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.



More information about the R-help mailing list