Aditya Bhagwat
2011-Jan-27 09:11 UTC
[R] Increasing grayscale value in scatter plot with number of points on particular location
Dear all, When making a plot with the command plot(xVector, yVector), there are many points that collide on the same place in the plot. In order to make this plot clearer, I have been looking for a way to colour the points based on the number of points that fall onto each other. If only one point falls on a particular location, make it gray, if many points fall, make it black. I tried to search the help archives, but didn't find any useful answers. Anyone has any suggestion? Many thanks for your help! Aditya -- Aditya Bhagwat [[alternative HTML version deleted]]
Prof Brian Ripley
2011-Jan-27 09:32 UTC
[R] Increasing grayscale value in scatter plot with number of points on particular location
This is one of the main points of supporting semi-transparent colours. You haven't told us your platform or graphics device (see the posting guide), but plotting with something like col=rgb(0,0,0,0.2) may work. On Thu, 27 Jan 2011, Aditya Bhagwat wrote:> Dear all, > > When making a plot with the command plot(xVector, yVector), there are many > points that collide on the same place in the plot. In order to make this > plot clearer, I have been looking for a way to colour the points based on > the number of points that fall onto each other. If only one point falls on a > particular location, make it gray, if many points fall, make it black. > > I tried to search the help archives, but didn't find any useful answers. > Anyone has any suggestion? > > Many thanks for your help! > > Aditya > > -- > Aditya Bhagwat > > [[alternative HTML version deleted]] > > ______________________________________________ > R-help at 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. >-- Brian D. Ripley, ripley at stats.ox.ac.uk Professor of Applied Statistics, http://www.stats.ox.ac.uk/~ripley/ University of Oxford, Tel: +44 1865 272861 (self) 1 South Parks Road, +44 1865 272866 (PA) Oxford OX1 3TG, UK Fax: +44 1865 272595