[R] changing pen mode [or adjusting for overlapping points?]

Ross Ihaka ihaka at stat.auckland.ac.nz
Wed Mar 12 04:53:56 CET 2003


Don Armstrong wrote:

> What I'm looking for is a way to plot two (very large) separate
> datasets on the same plot so that you can distinguish between the two.
> 
> EG: In this plot, http://rzlab.ucr.edu/images/test.png, the upper left
> region should be some unique color, so you can see where the red
> (currently hidden under the green) stops.

Interesting.  Some suggestions:

1) Change the plotting scales because all your points are clustering 
close to the top or left margins.  At a guess, try log(x) and log(1-y). 
  This should spread things out a bit.

2) You might get a better picture if you cut down the number of points 
you are plotting.

3) If you really want to use colour you will need to do some binning 
(which is implicit in your painting program analogy).  You could use a 
rectangular layout, or do hexagonal binning. Once you've binned you 
could colour a particular location according to the absolute and 
relative numbers of red and green points at that location.  For example, 
you could encode the total number of points at a location using HSV 
"value" and encode the proportion of reds as a location along a line 
joining maximal saturated red and green with the given "value". (i.e. 
values are encoded as a position in vertical slice through the HSV hexcone.)

Would it be possible to get the data to try some experiments?


-- 
Ross Ihaka                         Email:  ihaka at stat.auckland.ac.nz
Department of Statistics           Phone:  (64-9) 373-7599 x 85054
University of Auckland             Fax:    (64-9) 373-7018
Private Bag 92019, Auckland
New Zealand



More information about the R-help mailing list