#### plot three variables, represent the third with a color
d = mvrnorm(100, mu=c(0,0,0), Sigma=matrix(c(1, .6, .6, .6, 1, .6, .6, .6, 1), ncol=3))
plot(d[,1:2], col=number.to.colors(d[,3], c("black", "pink")), pch=16)
Run the code above in your browser using DataLab