R 中的 3D 绘图 - 使用第四维颜色
我正在使用plot3d函数在我的R脚本中绘制3D图。我想添加第四个维度,即颜色。我该怎么做?
具体来说,假设我有以下代码:
plot3d(x, y, z, col=cols, size=2, type='s')
如何根据充当第四维的值向量填充 cols
。
I am using the plot3d function to make a 3d plot in my R script. I'd like to add a 4th dimension, which will be color. How can I do this?
Specifically, assume I have the following code:
plot3d(x, y, z, col=cols, size=2, type='s')
how would I populate cols
based on a vector of values acting as my 4th dimension.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
只需制作一个颜色图,然后使用 c 变量的剪切版本对其进行索引:
Just make a colormap, and then index into it with a cut version of your c variable: