Learn R Programming

RSurvey (version 0.7-0)

Plot3d: Plot Surface using OpenGL

Description

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

Usage

Plot3d(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, respective
z
matrix; the values to be plotted. The number of rows and columns should be equal to the length(x) and length(y), respectively.
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, res
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 background color.

Details

The interpolated surface is rendered using rgl, a 3D visualization device system for Rbased on http://www.opengl.org/{OpenGL}. 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 <- project$data.grd
Plot3d(d)
rgl.quit()

Run the code above in your browser using DataLab