[R] symbols and legend: how to harmonize point size ?
patrick.giraudoux at univ-fcomte.fr
Fri Nov 11 20:06:31 CET 2011
I was wondering if it is possible to harmonize the ouput of symbols()
and legend() both from the graphics package.
Let us take this example:
leg<-round(seq(min(z),max(z),l=4),2) # 4 values rounded up to 2 decimals
for the legend
legend("topright",legend=leg,pch=1,pt.cex=leg/max(leg)*2) # multiplied
by 2 arbitrarily just to make it visible
Actually, what I want to do is to pass to pt.cex a value which would
make the biggest circle in the legend (leg/max(leg) = 1) exactly the
same size as the one specified in symbols (here 0.2 inches). I suppose
this is possible using par("cin") but I cannot figure out how to do it
Any hint appreciated,
More information about the R-help