问题描述
我在用rgl的mfrow3d
和misc3d的contour3d
显示多个3d图形时遇到麻烦。
特别是,绘制新的子图将导致删除所有先前的子图。这是一个简单的示例:
library(rgl)
library(misc3d)
# setup rgl subplots
mfrow3d(1,2)
# step into first subplot
next3d()
# Draw a ball
f <- function(x,y,z)x^2+y^2+z^2
x <- seq(-2,2,len=20)
contour3d(f,4,x,x)
# advance to next subplot
next3d()
# Ball with one corner removed.
contour3d(f,mask = function(x,z) x > 0 | y > 0 | z > 0,screen = list(x = 290,y = -20),color = "red",color2 = "white")
# the first subplot is removed
在对contour3d
的第一次调用中,第一个球在左侧绘制得很好。但是,在第二次调用contour3d
之后,在右边绘制了第二个图,但是删除了第一个图。
我在这里想念什么?我的直觉是我错过了contour3d
的参数,因为mfrow3d
与其他*3d
的绘图功能配合正常,而与contour3d
的配合却很好。
解决方法
暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!
如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。
小编邮箱:dio#foxmail.com (将#修改为@)