[R] A question regarding cex and pch="." in lattice

Prof Brian Ripley ripley at stats.ox.ac.uk
Tue Feb 6 22:05:47 CET 2007


How do you know the points are not being plotted?

All you can tell is that your graphics card / monitor / X11 driver is not
displaying them, not at all the same thing.

My guess is that the rectangle is being displayed only if the differences 
in its discretized x and y coordinates are both positive.  R tries hard to 
ensure that pch='.', cex=1 does always display a point, but not for 
smaller cex.

On Tue, 6 Feb 2007, Saptarshi Guha wrote:

> Hello,
> 	I'm using lattice and opened an X11 device with the following call
> 	X11(width=5,height=5,pointsize=1)
> 	I then ran the following code
>
> 	library(lattice)
> 	x<-rnorm(30,sd=2)
> 	y<-runif(30)
> 	xyplot(y~x,pch=".",col="black",cex=1)
>
> 	If i remove "cex=1", not all the points are plotted. From ?X11, i
> read,"pch='.' with cex=1 corresponds to a rectangle of sides the
> larger of one pixel and 0.01 inch"
>
> 	By way of information, i'm using a Dell 30", where the the pixel
> pitch is 0.250mm(0.0098 inch).
>
> 	My question, why is that some of the points are not being plotted
> when remove cex=1 ?

The default cex for this plot is 0.8. See trellis.par.get("plot.symbol").

> 	Regards
> 	Saptarshi
>
> Saptarshi Guha | sapsi at pobox.com | http://www.stat.purdue.edu/~sguha
>
>
> 	[[alternative HTML version deleted]]
>
> ______________________________________________
> R-help at stat.math.ethz.ch 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