The function is built on the openGL renderer of the R package rgl
. The default plotting window size is 800x800
pixels. In case you want to override this, please
use the function with defaultPar3d=FALSE
after running par3d
(windowRect=<>)
.
plot3d(x,...)# S3 method for trigrid
plot3d(x, type = c("l"), sphere = NULL, add = FALSE, guides = TRUE, ...)
# S3 method for hexagrid
plot3d(
x,
type = c("l"),
sphere = NULL,
color = "gray70",
add = FALSE,
guides = TRUE,
...
)
# S3 method for facelayer
plot3d(x, type = "f", frame = TRUE, guides = TRUE, defaultPar3d = TRUE, ...)
The function does not return any value.
An object of class function
of length 1.
(trigrid
, hexagrid
or facelayer
) Object to be plotted.
(character
) Value specifying the part of the grid to be plotted by the call of the function.
"v"
plots the grid vertex points.
"e"
draws the grid edges.
"f"
draws the grid faces.
"c"
draws the face centers of the grid.
(numeric
) Defaults to NULL
, adding a central white sphere to the plot. Assigning a numeric
value will draw a new sphere with the given radius,
FALSE
does not plot the sphere.
(logical
) Value indicating whether a new plot shall be drawn, or the currently plotted information should be added to the active rgl
device.
(logical
) Value indicating whether the guidelines of the polar coordinate system shall be plotted.
Further graphical parameters passed to (see plot3d
).
(character
) Only for the hexagrid plotting: value/values passed to the faces3d
function instead of col
.
(logical
) If set to TRUE the grid line structure will be plotted.
(logical
) Flag indicating whether the default settings for par3d
are to be used (windowRect = c(50, 60, 800, 800), zoom=0.8)
.
# create a hexagonal grid
g <- hexagrid(c(2,2))
# plot the grid in 3d space
# plot3d(g, col="blue")
# make a subset to select faces
subG <- subset(g, c("F5", "F2"))
# plot the subset defined above
# plot3d(subG, type="f", col=c("orange"), add=TRUE, lwd=1)
Run the code above in your browser using DataLab