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

Petr Pikal petr.pikal at precheza.cz
Wed Mar 12 14:58:59 CET 2003


Hi

On 11 Mar 2003 at 16:28, Don Armstrong wrote:

> On Tue, 11 Mar 2003, Marc Schwartz wrote:
> > 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
> > values.
> 
> Changing the pointsize helps a bit, however, it makes the points that
> aren't overlapped almost impossible to see. [Single pixels in a
> 1900x1600 plot are quite hard for my eyes to dicern, and it basically
> gets back to a mere density plot.]
> 
> What I'm really looking for is a method to adjust the mode in which
> the points are drawn, so that those that overlap a point of a
> different color produce yet a third color in the region of overlap.
>

something like that?

x<-rlnorm(10000)
y<-rnorm(10000,mean=0.5)
overlap<-which(abs(x-y)<.1)
plot(1:10000,x)
points(1:10000,y,col=2)
points((1:10000)[overlap],y[overlap],col=3)

 
> 
> Don Armstrong
> 
> -- 
> "I was thinking seven figures," he said, "but I would have taken a
> hundred grand. I'm not a greedy person." [All for a moldy bottle of
> tropicana.]
>  -- Sammi Hadzovic [in Andy Newman's 2003/02/14 NYT article.]
>  http://www.nytimes.com/2003/02/14/nyregion/14EYEB.html
> 
> http://www.donarmstrong.com
> http://www.anylevel.com
> http://rzlab.ucr.edu
> 

CheersPetr Pikal
petr.pikal at precheza.cz
p.pik at volny.cz



More information about the R-help mailing list