Skip to content
Prev 273145 / 398506 Next

Scatterplot with the 3rd dimension = color?

Duncan Murdoch <murdoch.duncan <at> gmail.com> writes:
or

d <- data.frame(x,y,z)
library(ggplot2)
qplot(x,y,colour=z,data=d)

  I agree about the "not particularly effective display"
comment, but if you have two continuous predictors and
a continuous response you've got a tough display problem --
your choices are:

  1. use color, size, or some other graphical characteristic
(pretty far down on the "Cleveland hierarchy")
  2. use a perspective plot (hard to get the right viewing
angle, often confusing)
  3. use coplots/small multiples/faceting (requires
discretizing one dimension)