Skip to content
Prev 171561 / 398506 Next

3D or 4D plot

One more followup on this:  I just added a function shapelist3d() to rgl 
(so far only on R-forge, not CRAN) that automates a lot of this.  To get 
the plot as below, the following code works:

x <- rep(1:5, each=25)
y <- rep(rep(1:5, each=5), 5)
z <- rep(1:5, 25)
shapelist3d(cube3d(), x,y,z, size=0.45, col=terrain.colors(125))

But now you can do fancier stuff, like

shapelist3d(list(tetrahedron3d(), cube3d(), octahedron3d(),
                  dodecahedron3d(), icosahedron3d()),
                  x,y,z, size=0.45, col=terrain.colors(125))

Duncan Murdoch
On 2/20/2009 2:28 PM, Duncan Murdoch wrote: