rgl:带有“扩展”的plot3d绘图符号
我正在尝试扩展可用于 3D 绘图的符号。在 2D 中,我使用:
x1 <- sort(rnorm(10))
y1 <- rnorm(10)
z1 <- rnorm(10) + atan2(x1, y1)
x2 <- sort(rnorm(10))
y2 <- rnorm(10)
z2 <- rnorm(10) + atan2(x2, y2)
x3 <- sort(rnorm(10))
y3 <- rnorm(10)
z3 <- rnorm(10) + atan2(x3, y3)
new.styles <- -1*c(9818:9824, 9829, 9830, 9831)
在 2D 中,我的绘图有效并给出了适当的符号:
plot(x1, y1, col="red", bg="red", pch=new.styles, cex = 2)
但是,在 3D 中,符号无法正确转换。
rgl::plot3d(x1, y1, z1, col="red", bg="red", pch=new.styles, size = 10)
符号将被(一个)圆圈取代。
我还尝试了 pch3d 并得到了空白图。然而,pch3d 确实可以使用“标准”绘图符号。
rgl::pch3d(x1, y1, z1, col="red", bg="red", pch=10:19, size = 10)
因此,至少这些符号似乎没有以 3D 形式显示。如何显示首选符号?
I am trying to extend the symbols available to me for plotting in 3D. In 2D, I use:
x1 <- sort(rnorm(10))
y1 <- rnorm(10)
z1 <- rnorm(10) + atan2(x1, y1)
x2 <- sort(rnorm(10))
y2 <- rnorm(10)
z2 <- rnorm(10) + atan2(x2, y2)
x3 <- sort(rnorm(10))
y3 <- rnorm(10)
z3 <- rnorm(10) + atan2(x3, y3)
new.styles <- -1*c(9818:9824, 9829, 9830, 9831)
In 2D, my plot works and gives the appropriate symbol:
plot(x1, y1, col="red", bg="red", pch=new.styles, cex = 2)
In 3D, however, the symbols do not get translated correctly.
rgl::plot3d(x1, y1, z1, col="red", bg="red", pch=new.styles, size = 10)
The symbols are getting replaced with (one) circle.
I also tried with pch3d and got blank plots. However, pch3d does work with the "standard" plotting symbols.
rgl::pch3d(x1, y1, z1, col="red", bg="red", pch=10:19, size = 10)
So, it appears to be that at least the symbols are not displaying in 3D. How can I display the preferred symbols?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我只能使用
text3d()
获得解决方案 - 希望存在更好的解决方案。得出的结果是:
这可能太复杂了,希望有更好的解决方案。
I was able to only get a solution using
text3d()
-- hopefully there exists a better solution.This yields the figure:
This may well be too complicated, hopefully there are better solutions out there.
这是我能做的最好的事情:
设置纹理/形状文件:
加载包,定义一个在随机点绘制纹理的函数:
This is the best I could do:
Set up file for texture/shape:
Load package, define a function to plot the texture at a random point: