[R] shading in image()

Ross Ihaka ihaka at r-project.org
Mon Aug 4 05:34:53 CEST 2003


Angel wrote:
> 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
> shading.
> 
> 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.

The short answer is that it is not possible.  The problem is that R
assumes an underlying vector graphics system rather than a raster one.
Vector systems provide flat-shaded polygons rather than interpolated
shading.

If anyone knows how to Gouraud, Phong or other smooth shading method
portably in a vector system I'd be keen to hear about it.

-- 
Ross Ihaka                         Email:  ihaka at r-project.org
The R Project and R Foundation




More information about the R-help mailing list