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

Marc Schwartz mschwartz at medanalytics.com
Tue Mar 11 22:18:39 CET 2003

>-----Original Message-----
>From: r-help-bounces at stat.math.ethz.ch 
>[mailto:r-help-bounces at stat.math.ethz.ch] On Behalf Of Don Armstrong
>Sent: Tuesday, March 11, 2003 2:43 PM
>To: r-help at stat.math.ethz.ch
>Subject: Re: [R] changing pen mode [or adjusting for 
>overlapping points?]
>On Tue, 11 Mar 2003, Spencer Graves wrote:
>>  plot(1:2, col=1:2)
>> Is this what you want?
>Unless I'm mistaken, that just alternates which color is set 
>for each point.
>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.
>Don Armstrong


Based upon that example, the code that I sent in my prior e-mail
should work and you may not even need to use jitter() in the points()
function call given the density of the scatterplot. You might try it
with and without using jitter() to see what makes sense for you.

You might also need to decide which set of points to draw first versus
second depending upon how they overlap.

Finally, you might also consider using the 'cex' argument in both
plot() and points(), which can reduce the size of the plotting
symbols. The default for par(cex) is 1.0, so you might try smaller

Hope that helps.

Marc Schwartz

More information about the R-help mailing list