surfacePlot: Surface plot

View source: R/surfacePlot.R

surfacePlotR Documentation

Surface plot

Description

Creates a surface plot to show three-dimensional data or a colored surface plot to show four-dimensional data.

Usage

surfacePlot(pre, z.color = "lightblue", Surface = list(name = "",
  lineColor = "black", levels = 20, ramp = "coolWarm"), xtitle = "",
  ytitle = "", ztitle = "", margin = c(NA, NA, NA, NA),
  caption = "")

Arguments

pre

the output from preSurface.

z.color

the surface color. Can be either a character string indicating the color of the surface, or a numeric matrix. If a matrix, then must have length(x) rows and length(y) columns or length(x) - 1 rows and length(y)-1 columns. Missing values are permitted, but result in blank areas on the surface. See Details.

Surface

control parameters for the surface. See Details.

xtitle

the x-axis title (also called x-axis caption).

ytitle

the y-axis title (also called y-axis caption).

ztitle

the z-axis title (also called z-axis caption).

margin

set up the plot area margins. To allocate space for a graph title, set the third value to 1.5, otherwise all values should be NA or 0.

caption

the figure caption.

Details

If z.color is a numeric matrix, then the values represent the average surface of the grid defined by x and y, that is it represents the value one-half way between each value of x and one-half way between each value of y, the mid point. If it has the same dimensions as z.surf, then the data are resampled by averaging each of the four corners to compute the mid point value. The values of z.color are assigned using the controls in Surface.
The Surface argument must be a tagged list with these components:

name

the name of z.color used in the explanation.

lineColor

the color for each line on the surface. If "none," then lines are not drawn.

levels

the levels of the surface colors. May be either a single numeric value that indicates the approximate number of levels, or a vector that indicates the exact breaks in the levels.

ramp

the name of the color ramp. May be "gray" or "grey" for a gray scale or the prefix name of a function that creates a range of colors, see coolWarm.colors for examples.

Value

Information about the graph.

Note

A call must be made to setPage or setPDF to set up the graphics environment before calling surfacePlot.

See Also

setPage, preSurface, persp

Examples

## Not run: 
# See for examples of surfacePlot:
vignette(topic="GraphGallery", package="smwrGraphs")

## End(Not run)

USGS-R/smwrGraphs documentation built on Oct. 11, 2022, 6:11 a.m.