-----Original Message-----
From: r-help-bounces at r-project.org [mailto:r-help-bounces at r-project.org] On Behalf Of Victor Gabillon
Sent: April-28-11 8:22 PM
To: r-help at r-project.org
Subject: [R] Change the text size of the title in a legend of a R plot.
Hello,
Is it possible to change the text size of the title in a legend of a R plot?
I tried to directly change the title.cex argument but it seems not to work.
Trying :
Horizo <- c(1,2,6,10,20)
legtext <- paste(Horizo,sep="")
legend("topleft", legend=legtext,col=col,text.col=col,lwd=lwd,
lty=lty,cex=1.1,ncol=3,title = "Horizons",title.col ="black",title.cex=1.4)
I haven't found any cex argument that works for just the legend title, but you
can get some modification of the title with the expression argument:
legend("topleft", legend=legtext,col=col,text.col=col,lwd=lwd, lty=lty,cex=1.1,ncol=3,
title = expression(bold("Horizons")),title.col="black")
Does that help?
Otherwise, you can of course figure out which functions do the legend plotting,
copy and modify those to get a title cex in place.
Steve McKinney
gives the following error (sorry in french):
Erreur dans legend("topleft", legend = legtext, col = col, text.col =
col, ?:
? ?argument(s) inutilis?(s) (title.cex = 1.4)
saying title.cex argument as been ignored.
Thank you for helping.
Victor