I’m currently generating 3D graphs in R using the persp-command. To change the viewpoint one has to set the parameters theta and phi. To evaluate (a good viewpoint on) the graph, one has to try lots of combinations for these parameters.
I was wondering if one can define an interactive output device that allows to rotate the graph using the mouse. It would be also nice if this device gives the current values for theta and phi.
Is there such a device/package?
See the rgl package: http://cran.r-project.org/web/packages/rgl/index.html
It won’t report the
thetaandphivalues you need, IIRC (though see @Dieter’s comment below for a solution to this), but you can usergl.snapshot()orrgl.postscript()to grab the current display as a bitmap or vector image. The package haspersp3d()which is very similar topersp().