I am trying to add the z=0 plane to a 3D plot. The code I use is
library(plot3D)
zero = matrix(0, 20, 20)
persp3D(x=seq(1,20), y=seq(1,20), z = Delta_B, theta = 20, xlab = "D", ylab = "IR", zlab = "B increment")
persp3D(x=seq(1,20), y=seq(1,20), z = zero, col = "black", add = T)
But the z=0 plane does not appear.
If I jitter the plane with
zero = jitter(matrix(0, 20, 20))
Then I can see it properly.
In fact trying to plot the plane alone produces and empty graph.
persp3D(x=seq(1,20), y=seq(1,20), z = zero, col = "black")
EDIT
A partial solution would be to use
zero = jitter(matrix(0, 20, 20)) / 10000
which results in a plane that is indistinguishable from the intended one.