[R] combination of scatterplot and image graph
bitwrit at ozemail.com.au
Sat Dec 25 09:26:48 CET 2004
bogdan romocea wrote:
> Dear R users,
> I'm interested in a combination of a scatterplot and an image graph.
> I have two large vectors. Because in the scatterplot some areas are
> sparsely and others densely populated, I want to see the points, and
> I also want their color to be changed based on their density (similar
> to a heat map). Is there a function that can do that?
This looked much like a function in the "plotrix" package, and I found it was
quite easy to modify one of the functions to do what I think you want. Try
installing "plotrix" and sourcing this function.
if(length(redrange) > 1) reds<-rescale(x,redrange)
if(length(greenrange) > 1) greens<-rescale(x,greenrange)
if(length(bluerange) > 1) blues<-rescale(x,bluerange)
I've made up the color endpoints, of course. This looks so useful that I will
include it in the next version of plotrix.
More information about the R-help