[R] 3D stariway plot

Stefan Evert stefanML at collocations.de
Tue Aug 24 10:47:58 CEST 2010


On 24 Aug 2010, at 02:20, Ben Bolker wrote:

>> Please, is there an R function /package that allows for 3D stairway plots
> like the attached one ?
>> In addition, how can I overlay a parametric grid plot??
> 
>  Not exactly, that I know of, but maybe you can adapt
> 
> library(rgl)
> demo(hist3d)
> 
>  to do what you want.


The drawback here, of course, is that the resolution of rgl isn't good enough if you want to include the plot in a paper.  For that purpose, I've recently used panel.3dbars() from the "latticeExtra" package.  I don't have a self-contained example at hand, but the idea is to call the lattice function cloud() and pass panel.3dbars() as an argument:

	library("latticeExtra")
	cloud( ... data and options ..., panel.3d.cloud = panel.3dbars)

See ?panel.3dbars for a complete example.  I don't know how flexible these plots are and whether you can exactly reproduce your example.

Best,
Stefan



More information about the R-help mailing list