Skip to content
Prev 258388 / 398502 Next

Change the text size of the title in a legend of a R plot.

Hi Victor,

looking at the code for legend, it looks like the same 'cex' value is
used for the text in the legend as the title.

Here is a trick though: draw the legend twice, with different cex
values, and omitting title or text:


plot(1)
legend("topright",c("a","b"),title=" ")
legend("topright",c(" "," "),title="Legend",cex=0.6, bty='n', title.adj=0.15)


A bit of a hack but it works....
If you want the title larger, it will probably not fit the box, which
you can omit by setting bty='n' (as in the second line).

good luck,

Remko



-------------------------------------------------
Remko Duursma
Research Lecturer

Centre for Plants and the Environment
University of Western Sydney
Hawkesbury Campus
Richmond NSW 2753

Mobile: +61 (0)422 096908
www.remkoduursma.com
On Fri, Apr 29, 2011 at 3:15 PM, Steven McKinney <smckinney at bccrc.ca> wrote: