Skip to contents

This function is used to plot the faces of either a trigrid, hexagrid or facelayer object in 3D space.

Usage

faces3d(x, ...)

# S4 method for trigrid
faces3d(x, ...)

# S4 method for hexagrid
faces3d(x, ...)

# S4 method for facelayer
faces3d(x, col = "heat", breaks = NULL, inclusive = TRUE, legend = TRUE, ...)

Arguments

x

The trigrid, hexagrid or facelayer object to be plotted.

...

Further graphical parameters passed to (see plot3d) and the heatMapLegend function.

col

(character) Graphical parameter indicating the colours of the faces. A single value is accepted for logical values. Multiple colors will be passed to colorRampPalette, to create palettes for heat maps in case of numeric values. The default plotting method in this case is the reversed heat.colors. In case of categorical data, random colors will be chosen.

breaks

(numeric) Vector stating the breakpoints between the plotted levels. The argument is passed to the cut function.

inclusive

(logical): If there are values beyond the limits of breaks, should these be represented in the plot (TRUE) or left out completely FALSE?

legend

(logical) Should the heatmap legend be plotted?

Value

The function does not return any value.

Details

The function is built on the openGL renderer of the R package rgl.

Examples

# create a hexagonal grid
    g <- hexagrid(c(2,2))
# plot the grid in 3d space
# faces3d(g)
h <- hexagrid(8)
b <- facelayer(h)
values(b)<- rnorm(length(b))