[R] How does the cex parameter scale circles?

Prof Brian Ripley ripley at stats.ox.ac.uk
Wed Mar 9 17:33:28 CET 2011


'cex' means character expansion.  It is linear magnification: that is 
all linear dimensions (including height and width) are proportional to 
cex).

You are confusing matters by giving a lattice example.  'cex' is a 
concept from base graphics (see ?par, which I believe is unambiguous 
in saying it is a magnification), but lattice is built on grid.  And 
?grid::gpar says

        cex         Multiplier applied to fontsize


On Wed, 9 Mar 2011, Al Roark wrote:

> I'm wondering how the cex parameter is used to scale circles (i.e. 
> does it scale the radius, diameter, area, circumference, etc.?). In 
> my case I'm using lattice with filled circles (pch=19).
>
> Based on example, it looks like R scales the radius of the circle:
>
> library(lattice)
> dta<-data.frame(x=rep(1,6),y=rep(1,6),sz=c(1,2,4,8,16,32))
> xyplot(x~y,data=dta,col=rgb(0,0,0,50,maxColorValue=255),cex=dta$sz,pch=19)
>
> But I haven't been able to find confirmation in any R documentation, 
> so any assistance would be much appreciated. Cheers.
> 	[[alternative HTML version deleted]]
>
> ______________________________________________
> R-help at 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.
>

-- 
Brian D. Ripley,                  ripley at stats.ox.ac.uk
Professor of Applied Statistics,  http://www.stats.ox.ac.uk/~ripley/
University of Oxford,             Tel:  +44 1865 272861 (self)
1 South Parks Road,                     +44 1865 272866 (PA)
Oxford OX1 3TG, UK                Fax:  +44 1865 272595



More information about the R-help mailing list