I have a simple scatter plot
x<-rnorm(100)
y<-rnorm(100)
z<-rnorm(100)
I want to plot the plot(x,y)
but the color of the points should be color coded based on z
.
Also, I would like to have the ability to define how many groups (and thus colours) z
should have. And that this grouping should be resistant to outliers (maybe split the z
density into n
equal density groups).
Till now I do this manually, is there any way to do this automatically?
Note: I want to do this with base R not with ggplot
.