[R] making scatter plot points fill semi-transparent

per freem perfreem at gmail.com
Thu Aug 6 05:48:05 CEST 2009

hi all,

i have a simple scatter plot, and i'd like to make it so the scatter
plot colors are slightly transparent. i see in a previous post that
someone mentioned the "alpha" parameter, but i am not sure how it can
be used with the 'plot' function [*].

for example, suppose i have:

plot(mydata$column1, mydata$column2, col="red", cex=1)

i now want to make it so the color of these points (in this case red)
is slightly transparent, which will make overlap between them very
obvious. i realize that hexbin and other density plot methods are used
to make this, but i am using it for a different purpose, and so i just
want the points to be transparent without any binning or shading.

a previous poster suggested:

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

but i don't understand this color notation. is there any way to pass
in the usual col="colorname" argument and then tweak that color's

thank you.


More information about the R-help mailing list