Question 1: I would use a linear model to add planes, as I describe here and as the package authors use in the vignette:
plot3d <- scatterplot3d(x, y, z, ... )
model <- lm(y ~ x + z)
plot3d$plane3d(model)
You can specify the xyz intercepts manually, but I don't recommend it, as it produces somewhat odd behaviour. You can also construct complex mesh surfaces using the function intended for points, but as the authors state in the vignette:
Note that scatterplot3d is designed to generate scatter plots, not to
draw surfaces, is not really user friendly for this purpose,
for which we'd typically rather use R's persp function.
Question 2: The vector with three elements is a container for the xyz intercepts. You can specify them manually as you did above with s3d$plane3d(6,0,0)
. The x and y coefficients appear to be for mapping those two variables onto a plane.
To make specific planes manually, here is a suggestion from Uwe himself:
spd <- scatterplot3d(1:10, 1:10, 1:10)
# xy
spd$plane3d(0.3549896,0,0,lty="dotted")
# yz
x0 <- 5
xyz1 <- spd$xyz.convert(rep(x0, 6), rep(0, 6), seq(0, 10, by=2))
xyz2 <- spd$xyz.convert(rep(x0, 6), rep(10, 6), seq(0, 10, by=2))
segments(xyz1$x, xyz1$y, xyz2$x, xyz2$y, lty="dotted")
xyz1 <- spd$xyz.convert(rep(x0, 6), seq(0, 10, by=2), rep(0, 6))
xyz2 <- spd$xyz.convert(rep(x0, 6), seq(0, 10, by=2), rep(10, 6))
segments(xyz1$x, xyz1$y, xyz2$x, xyz2$y, lty="dotted")
# zx
y0 <- 6
xyz1 <- spd$xyz.convert(rep(0, 6), rep(y0, 6), seq(0, 10, by=2))
xyz2 <- spd$xyz.convert(rep(10, 6), rep(y0, 6), seq(0, 10, by=2))
segments(xyz1$x, xyz1$y, xyz2$x, xyz2$y, lty="dotted")
xyz1 <- spd$xyz.convert(seq(0, 10, by=2), rep(y0, 6), rep(0, 6))
xyz2 <- spd$xyz.convert(seq(0, 10, by=2), rep(y0, 6), rep(10, 6))
segments(xyz1$x, xyz1$y, xyz2$x, xyz2$y, lty="dotted")
The points are first sampled at a regular interval matching the grid in xyz space using their built-in xyz coordinate conversion function, before mapping the segments between them, producing grids:
