It can be as simple as:

> plot( rnorm(1000), rnorm(1000), col="#0000ff22", pch=16,cex=3)

Where the color is "#RRGGBBAA" and the AA portion is the
opacity/trasparency.  Of course this only works if you are using a
graphics device that supports transparency.  The windows device under R
2.6.0 does (but not any previous versions), the Cairo device does, the
PDF device does (as long as you set the correct options), and I think
the default device on Macs does, I don't know which others do.

The rgl package has another way of doing this (but may be overkill for
your approach).

If you are interested in plotting lots of points, look at the hexbin
package (bioconductor I think) for an alternative way of presenting the
data.

Hope this helps,

-- 
Gregory (Greg) L. Snow Ph.D.
Statistical Data Center
Intermountain Healthcare
[EMAIL PROTECTED]
(801) 408-8111
 
 

> -----Original Message-----
> From: [EMAIL PROTECTED] 
> [mailto:[EMAIL PROTECTED] On Behalf Of Markus Loecher
> Sent: Wednesday, October 10, 2007 9:48 AM
> To: [EMAIL PROTECTED]
> Subject: [R] transparent colors
> 
> Dear R graphics experts,
> Do you know of any way of plotting semi-transparent points in R ?
> I face this problem any time I want to e.g. plot thousands of 
> points that belong to two or three classes which I color code.
> With the default opaque colors, the plotting order matters 
> and basically the points I plot last completely dominate the 
> picture. I would much rather have the overlaying points mix in color..
> 
> Thanks a lot,
> Markus
> 
> ______________________________________________
> R-help@r-project.org 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.
> 

______________________________________________
R-help@r-project.org 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.

Reply via email to