[R] complicated graphic -- persp+map

Duncan Murdoch murdoch.duncan at gmail.com
Sun Oct 31 21:33:50 CET 2010


On 31/10/2010 1:29 PM, claudia tebaldi wrote:
> Hello
>
> I'm trying to render in 3D what I usually plot by image(), or image.plot()
> from the library fields, followed by a map("world",add=TRUE) type of
> command. More concretely, I have a field of temperature values, for a given
> geographic area, and I would like to plot a 3D surface whose x and y axes
> consist of longitude and latitude values and whose height and color-coding
> correspond to the temperature values but also -- and here is the problem --
> superimpose a map of the region.
> persp() can easily do the color-coded surface but I cannot figure out how
> (if at all possible) to overlay geographic boundaries, in this specific case
> a simple map of the land area outlines.

This is possible in rgl; see example(persp3d).  (This is working in R 
2.11.1, but not in the CRAN build of R 2.12.0 at the moment.  If you 
build it yourself it works there.)

Duncan Murdoch



More information about the R-help mailing list