I'm trying to use scale_colour_gradientn to clearly show neg vs pos values: negative is blue, positive is red. But gradientn seems to ignore my vector of colors, and just makes one big gradient instead of n small gradients. Here's my sample code ...
xx <- -100:100
yy <- xx
fma <- data.frame( xx, yy)
ggplot( fma) +
geom_point( aes( xx, yy, col=yy)) +
scale_colour_gradientn(
colours=c('#0000ff','#0000ff','#ff0000','#ff0000'),
values=c( -100, -1, 1, 100))
How can I convince gradientn to color everything in [-100,-1] blue and everything in [1,100] red?