Is there an interactive output device to view 3D graphs in R?

╄→尐↘猪︶ㄣ 提交于 2019-12-10 04:34:20

问题


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?


回答1:


See the rgl package: http://cran.r-project.org/web/packages/rgl/index.html

It won't report the theta and phi values you need, IIRC (though see @Dieter's comment below for a solution to this), but you can use rgl.snapshot() or rgl.postscript() to grab the current display as a bitmap or vector image. The package has persp3d() which is very similar to persp().




回答2:


See the package rggobi http://cran.r-project.org/web/packages/rggobi/index.html

For data visualisation in 3 or even more dimensions, try the package rggobi which makes use of the program ggobi. It is possible to manipulate the data using the mouse, "brush" data, identify points in the data all while visualizing in a number of dimensions.



来源:https://stackoverflow.com/questions/7977313/is-there-an-interactive-output-device-to-view-3d-graphs-in-r

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!