# Setup blank base plot
p <- plot3js(draw_grid = FALSE, xlab = "X", ylab = "Y", zlab = "Z")
# Add a box
p <- box3js(p)
# Add grid lines but only for the z axis
p <- grid3js(
p, col = "red",
axes = "z"
)
r3js(p)
# Add grid lines but only for the z axis and
# only at either end of the x axis
p <- grid3js(
p, col = "blue",
axes = "z",
sides = "x"
)
r3js(p)
Run the code above in your browser using DataLab