Spencer Graves
Marc Schwartz wrote:
-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Don Armstrong
Sent: Tuesday, March 11, 2003 2:08 PM
To: [EMAIL PROTECTED]
Subject: [R] changing pen mode [or adjusting for overlapping points?]
I'm ploting a rather large number of points [~24,000] in two series with slightly different distributions.
I would like to be able to effectively see where the two distributions overlap by setting the pen mode (or it's equivalent) to allow the overlapping portion to show up as a different color (or different shade).
Unfortunatly, I couldn't find an option in par or postscript that looks like it would be of use.
Ideas or suggestions?
Don Armstrong
I may be mis-understanding what you are trying to do, but if you are using plot() to generate a scatter plot (as opposed to a density plot) and there are actual overlapping points between the two sets, you could use jitter() to introduce some random noise into the plotted points.
Something like this might work, presuming that (x1, y1) and (x2, y2) are your two sets of points:
plot(x1, y1, pch = 16, col = "red") points(jitter(x2), jitter(y2), pch = 16, col = "blue")
The first plot() draws the initial set of data and points() adds the second set of data to the same plot, but in a different color with some random noise added to the points.
If that is not what you need, let us know.
Marc Schwartz
______________________________________________ [EMAIL PROTECTED] mailing list https://www.stat.math.ethz.ch/mailman/listinfo/r-help
______________________________________________ [EMAIL PROTECTED] mailing list https://www.stat.math.ethz.ch/mailman/listinfo/r-help
