grid3js.Rd
This is used for example by plot3js()
to add axis grids to a plot
these show along the faces of the plotting box, indicating axis ticks.
The data3js object
The axis sides to show the box, any combination of "x", "y" or "z"
Axes for which to draw the grid lines
Where to draw grid lines along the axis
Should edges of the box closest to the viewer hide themselves automatically
Grid line color
Grid line width
Should the lines be rendered as a physical geometry in the scene (see lines3js()
)
Other arguments to pass to material3js()
Returns an updated data3js object
Other plot components:
arrows3js()
,
axis3js()
,
box3js()
,
legend3js()
,
light3js()
,
lines3js()
,
mtext3js()
,
points3js()
,
segments3js()
,
shape3js()
,
sphere3js()
,
surface3js()
,
text3js()
,
triangle3js()
# 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)