Learn R Programming

RSurvey (version 0.6-0)

PlotSurface3d: Plot Surface using OpenGL

Description

Draws a three-dimensional (3D) surface plot.

Usage

PlotSurface3d(x = NULL, y = NULL, z = NULL, px = NULL, py = NULL, 
              pz = NULL, xlim = NULL, ylim = NULL, zlim = NULL,
              vasp = NA, hasp = NA, width = 7, ppi = 96, 
              cex.pts = 1, nlevels = 20, 
              color.palette = terrain.colors, 
              mouse.mode = c("trackball", "zAxis", "zoom"), 
              bg = "white")

Arguments

x, y
numeric; locations of grid lines at which the values in z are measured. These must be in ascending order. If x is a list, its components x$x and x$y are used for x and y, respect
z
matrix; the values to be plotted.
px
numeric; a vector of x coordinates for points in the plot. If px is a list, its components px$px, px$py and px$pz are used for px, py and pz, r
py
numeric; a vector of y coordinates for points in the plot.
pz
numeric; a vector of z coordinates for points in the plot.
xlim
numeric; a vector of x limits (x1,x2) for the plot.
ylim
numeric; a vector of y limits (y1,y2) for the plot.
zlim
numeric; a vector of z limits (z1,z2) for the plot.
vasp
numeric; the z/x aspect ratio.
hasp
numeric; the y/x aspect ratio.
width
numeric; the width of the plotting window canvas in inches.
ppi
integer; screen resolution in points per inch.
cex.pts
numeric; the amount by which point symbols should be magnified relative to the default.
nlevels
integer; number of contour levels desired.
color.palette
function; a color palette to be used to assign colors in the plot.
mouse.mode
character; a vector of 3 strings describing what the 3 mouse buttons do, see par3d.
bg
character; the primary color for the background.

Details

The interpolated surface data is rendered using rgl, a 3D visualization device system for Rbased on OpenGL, http://www.opengl.org/. The mouse is used for interactive viewpoint navigation where the left, right, and center mouse buttons rotate the scene, rotate the scene around the x-axis, and zooms the display, respectively.

See Also

surface3d, points3d

Examples

Run this code
data(project)
d <- Data("data.grd")
PlotSurface3d(d)
rgl.quit()

Run the code above in your browser using DataLab