I use the function filled.contourto build a contour map. I want to imagine the area around the optimum value in dark color and all other areas in light color.
filled.contour
library(gplots) a <- expand.grid(1:20, 1:20) b <- matrix(a[, 1] + a[, 2], 20) filled.contour(x = 1:20, y = 1:20, z = b, plot.axes = { axis(1); axis(2); points(10, 10) }, col = colorpanel(10, "white", "grey10"))
I want to represent (10,10) the coordinates in dark gray and all other areas in light color. I also tried RColorBrewerand colorRampPalettechange the gradients, but did not give the desired result. How to change color gradients to achieve my goal?
RColorBrewer
colorRampPalette
Regards, Ashwani
- , layout. x , :
layout
rect(7,9.5,8,10.5,col='red')
?filled.contour, , . , , , , .
?filled.contour
a <- expand.grid(1:20, 1:20) b <- matrix(a[,1] + a[,2], 20) filled.contour(x = 1:20, y = 1:20, z = b, plot.axes = { axis(1); axis(2); points(10, 10) })