plot3d {icosa}R Documentation

3d plotting of an icosahedral grid, its subset or a data layer

Description

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=<>).

Usage

plot3d(x,...)

## S3 method for class 'trigrid'
plot3d(x, type = c("l"), sphere = NULL, add = FALSE, guides = TRUE, ...)

## S3 method for class 'hexagrid'
plot3d(
  x,
  type = c("l"),
  sphere = NULL,
  color = "gray70",
  add = FALSE,
  guides = TRUE,
  ...
)

## S3 method for class 'facelayer'
plot3d(x, type = "f", frame = TRUE, guides = TRUE, defaultPar3d = TRUE, ...)

Arguments

x

(trigrid, hexagrid or facelayer) Object to be plotted.

type

(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.

sphere

(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.

add

(logical) Value indicating whether a new plot shall be drawn, or the currently plotted information should be added to the active rgl device.

guides

(logical) Value indicating whether the guidelines of the polar coordinate system shall be plotted.

...

Further graphical parameters passed to (see plot3d).

color

(character) Only for the hexagrid plotting: value/values passed to the faces3d function instead of col.

frame

(logical) If set to TRUE the grid line structure will be plotted.

defaultPar3d

(logical) Flag indicating whether the default settings for par3d are to be used (windowRect = c(50, 60, 800, 800), zoom=0.8).

Format

An object of class function of length 1.

Value

The function does not return any value.

Examples

# 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)

[Package icosa version 0.11.0 Index]