I have the following data with the following colors
x = c(2,3,4,2,3,7,8,7,5,6,2,3,6,8,9,10) y = c(5,6,5,6,5,11,12,11,16,17,12,12,10,5,6,5) col = sample(c("red","green"),16,rep=T) plot(x,y,col=col,xlim=c(0,20),ylim=c(0,20),pch=16)
If you run this code, you can see its 2D plot from 0 to 20 in both x and y directions. I would like to smooth out the colors that are now red and green, and should remain so. This means that in areas with red and green dots, they will turn brownish. Parts of the plot that are currently colorless should be white. Thus, there should be white areas, red areas, green areas, brown areas and areas between them.
More formally speaking, you can think of it as color interpolation, I suppose.