如何使用grid3d沿xy,xz和yz平面放置三个网格?

时间:2017-03-10 07:14:10

标签: r rgl

我正在使用R和rgl。我想沿着xy,xz和yz平面添加网格,穿过原点,而不是沿着边界框。有点像这样:

3D graph with grids going through origin

我很确定我需要grid3d(),但我不知道要使用哪些参数。

1 个答案:

答案 0 :(得分:2)

使用类似的东西:

xyz <- matrix(rnorm(30), ncol = 3)
plot3d(xyz, axes = FALSE)
abclines3d(x = matrix(0, ncol=3), a = diag(3), col="black", lwd=3)
grid3d("x", at = list(x = 0), col = "blue")
grid3d("y", at = list(y = 0), col = "red")
grid3d("z", at = list(z = 0), col = "green")