r legend trouble , how to change the text size in legend

zhuoer picture zhuoer · Jun 3, 2013 · Viewed 79.9k times · Source

I think cex doesn't work. Cex will change the whole scale of the legend. But I just want to enlarge the text size. any command will help?

Answer

Jilber Urbina picture Jilber Urbina · Jun 3, 2013

Yes!, set pt.cex = 1 and change cex as you want as in:

plot(c(1,1))
legend("topleft", "Legend", cex=1.3, pch=1, pt.cex = 1)