Warning.... very novice question follows:
I am trying to plot a fairly regular distribution of several thousand (X,Y) points each associated with a value, let\'s cal
Have you looked at scale_gradient
in ggplot? Or scale_brewer
for discrete colours? Here's an example of scale_gradient
dat <- data.frame(x = rnorm(1000), y = rnorm(1000), z = sample(-20:20, 1000, TRUE))
p <- ggplot(dat, aes(x, y, colour = z)) + geom_point()
p + scale_colour_gradient()
p + scale_colour_gradient(low = "red", high = "blue")
p + scale_colour_gradient2(low = "red", mid = "white", high = "blue")