r - 从plot3d绘图中保存3D图形应用程序的文件

标签 r plot export visualization rgl

我有一个数据集 3D 点 (x,y,z)。我用plot3Drgl绘制了这个数据集,我希望保存一个文件,以便在一些3D图形软件中使用这个文件并向我的同事展示

library(plot3Drgl)
data <- data.frame(x=c(23,45,12,67,89,45,32,56,78,32),y=c(89,54,32,67,78,56,44,28,97,65),z=c(1,5,4,3,7,6,3,8,9))
        plot3d(z = data$z , x = data$x , y = data$y, pch=21,cex = 0.1,aspect = F,box = F,axes = F)

最佳答案

我不知道你到底想要什么。您可以输出交互式 HTML 文件

library(rgl)
browseURL(paste("file://", writeWebGL(dir=file.path(tempdir(), "webGL"), width=500), sep=""))

enter image description here

或者您可以将数据保存到 csv 中,以便在另一个应用程序中加载和处理它:

write.csv(data, tf <- tempfile(fileext = ".csv"))
cat(tf)
# C:\Windows\TEMP\RtmpApi4a2\file26dc359447f.csv

关于r - 从plot3d绘图中保存3D图形应用程序的文件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31351815/

相关文章:

r - 如何将列表列表转换为列表数组?

python - 多项/条件 Logit 回归,为什么 StatsModel 在 mlogit 包示例上失败?

python - 如何在Python中的段上实现/执行DFT?

r - r中的情节标题中的下标

r - R 中 Tomek 链接的快速计算

r - R中的基本日历显示

python - 使用 cartopy 在其他投影中绘制投影数据

java - 如何使用 writeObject() 将 txt 导出到字符串中的路径?

jenkins - 如何导出/导入 Jenkins 配置?

mysql - 通过 PHPMyAdmin 导出 MySQL 数据库