[R] 3D Histograms on a Geographical Map

Barry Rowlingson b.rowlingson at lancaster.ac.uk
Fri Apr 19 16:38:54 CEST 2013


On Fri, Apr 19, 2013 at 3:13 PM, Lorenzo Isella
<lorenzo.isella at gmail.com> wrote:
> Dear All,
> I like very much figure 2.a) and 2.b) of this paper
>
> http://www.nature.com/srep/2013/130410/srep01640/pdf/srep01640.pdf
>
>
> and I probably need a similar visualization.
> Is anything like that doable in R? I have some experience with R and
> gadm (gadm.org), but that is only to produce maps colored according to
> a scalar.
> I do not know how to visualize maps with a "perspective", let alone
> adding the histograms in 3D.
> Sorry for not providing an example script, but if I had one I would
> not be posting at all.

 The panel B maps are "created by using R" so they are definitely
doable in R. I suspect they are using the rgl package for 3d graphics.
You just have to get the country outline data, give it a Z of 0, draw
it using the rgl 3d line functions, then add the bars (they're not
histograms) by starting at (x,y,0) and drawing a 3d line to (x,y,H)
for each value of H.

 You might try asking on R-sig-geo for more on mapping stuff with R.

 Clearly my papers don't have enough 3d nonsense graphics to get into Nature...

Barry



More information about the R-help mailing list