Hi,

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:

x<-runif(10)
y<-runif(10)
z<-runif(10)

leg<-round(seq(min(z),max(z),l=4),2) # 4 values rounded up to 2 decimals for the legend

symbols(x,y,circles=z,inches=0.2)

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 properly.

Any hint appreciated,

Best,

Patrick

______________________________________________
R-help@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.

Reply via email to