[R] determining the order in which points are plotted

Mike Miller mbmiller+l at gmail.com
Tue Jan 25 08:24:04 CET 2011


On Mon, 24 Jan 2011, Peter Ehlers wrote:

> 10 x 10 strikes me as pretty near the limit of usefulness of a pairs 
> plot. You might want to investigate the xysplom() function in pkg:HH. 
> You'll have to write your own panel function, possibly subsetting your 
> data with the scale() function.


The 10 x 10 scatterplot matrix actually works fine for me.  Here's an 
example:

http://genetsim.org/scatterplot_all.png

I can zoom in and scroll around looking at various individual 
scatterplots.

But thanks for the tip on xysplom().  I hadn't heard of it.

We do seem to be getting off-track.  The issue here is the order in which 
points are plotted -- if many points are in a small region, which points 
will be plotted last and remain visible?  Apparently, points() lets me 
control this for a single scatterplot.  I'm looking at the source code of 
scatterplot.matrix().  If you download the source here...

http://cran.r-project.org/src/contrib/car_2.0-8.tar.gz

...and unzip it, then you can find the scatterplot.matrix() source here:

car/R/scatterplotMatrix.R

I can see the problem.  When plots are done by group, the points for 
groups are laid down for the entire first group, then the entire second 
group, and so on.  It might be possible for me to alter this code to make 
something that will work for me.

Thanks to all for the help with this.  (It's surprising how helpful a 
single word preceded by a question mark can be.)

Mike



More information about the R-help mailing list