powered by
Create a two-color palette from one color to another through some third color
twocolorpal(colors = c("slateblue", "white", "violetred"), n = 256, ...)
Vector of colors, from blue to white to red
Vector of three colors
Number of colors in output.
Passed to grDevices::colorRampPalette().
grDevices::colorRampPalette()
revgray()
x <- matrix(rnorm(100, 0.5), ncol=10) mxabs <- max(abs(x)) image(x, col=twocolorpal(), zlim=c(-mxabs, mxabs))
Run the code above in your browser using DataLab