powered by
gradient.legend(y = NULL, yrange = NULL, cols = c("red", "blue"), location = c(0.075, 0.3, 0.575, 0.975), n = 100, ...)
number.to.colors
colorRampPalette
y = rnorm(100); x = .6*y + rnorm(100,0,sqrt(1-.6^2)) randnum = runif(100) plot(x,y, col=number.to.colors(randnum), pch=16) gradient.legend(randnum, xlab="", ylab="")
Run the code above in your browser using DataLab