[R] shading in image()
angel_lul at hotmail.com
Fri Aug 1 11:05:21 CEST 2003
Is there a way to make a shading interpolation on an image plot?
Something similar to matlab 'shading interp', I think it is called Gouraud
What I want is to make a image plot look nicer. with image() it looks very
facetted, and I would like to make it look smoother.
I've tried with interp.surface() in fields package but it (obviously) makes
nan values at the borders and around nan.
Maybe an example would make me explain better:
x <- 10*(1:nrow(volcano))
y <- 10*(1:ncol(volcano))
image(x, y, volcano, col = terrain.colors(100))
## This is what I've tried with interp.surface()
image(newx,newy,volcano2, col = terrain.colors(100))
As you see NANs are lareger in the interpolated image, I've modified the
interp.surface function to take the nearest neightbour when any of the 4
bounding points is NA but the result is still not perfect, thats why I'm
looking for a function that does Gouraud shading.
Thanks for all the help,
More information about the R-help