是否有交互式输出设备可以在 R 中查看 3D 图形? [英] Is there an interactive output device to view 3D graphs in R?

查看:31
本文介绍了是否有交互式输出设备可以在 R 中查看 3D 图形?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我目前正在使用 persp 命令在 R 中生成 3D 图形.要改变视点,必须设置参数thetaphi.为了评估(一个好的观点)图表,人们必须为这些参数尝试很多组合.

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.

我想知道是否可以定义一种允许使用鼠标旋转图形的交互式输出设备.如果这个设备给出 thetaphi 的当前值,那也很好.

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.

有这样的设备/包吗?

推荐答案

查看 rgl 包:http://cran.r-project.org/web/packages/rgl/index.html

它不会报告您需要的 thetaphi 值,IIRC(尽管请参阅下面@Dieter 的评论以获取解决方案),但您可以使用 rgl.snapshot()rgl.postscript() 将当前显示抓取为位图或矢量图像.该包具有 persp3d(),它与 persp() 非常相似.

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().

这篇关于是否有交互式输出设备可以在 R 中查看 3D 图形?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆