[R] Increasing grayscale value in scatter plot with number of points on particular location

Prof Brian Ripley ripley at stats.ox.ac.uk
Thu Jan 27 11:05:02 CET 2011


On Thu, 27 Jan 2011, Aditya Bhagwat wrote:

> Dear Prof. Ripley,
> 
> Thanks for your reply.
>
>       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.
> 
> 
> I am working on Ubuntu Linux. and I tried the suggested approach but got an
> empty plot and the following warning message:
> In plot.xy(xy, type, ...) :
>   semi-transparency is not supported on this device: reported only once per
> page
> 
> Any suggestions on how to proceed?

Use a device that supports transparency: X11() ought to on a Linux 
box, pdf() does everywhere.

> 
> Many thanks,
> 
> Aditya
> 
> 
> 
> 
> 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
> 
> 
> 
> 
> --
> Aditya Bhagwat
> 
> 
> 
>

-- 
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


More information about the R-help mailing list