asymmetric color distribution in scale_gradient2? asymmetric color distribution in scale_gradient2? r r

asymmetric color distribution in scale_gradient2?


What you want is scale_fill_gradientn. The arguments are not very clear (took me an hour or so to finally figure part of it out), though:

library("scales")p + scale_fill_gradientn(colours = c("blue","white","red"),                          values = rescale(c(-.1,0,.3)),                         guide = "colorbar", limits=c(-.1,.3))

Which gives:

enter image description here