Learn R Programming

RSurvey (version 0.6-0)

PlotSurface2d: Plot Points or Interpolated Surface

Description

Draws a scatter plot or contour plot with arrows. A key showing how the colors map to state variable values is shown to the right of the plot.

Usage

PlotSurface2d(x = NULL, y = NULL, z = NULL, vx = NULL, vy = NULL, 
              type = "p", xlim = NULL, ylim = NULL, zlim = NULL, 
              xlab = NULL, ylab = NULL, zlab = NULL, asp = NA, 
              csi = NA, width = 7, pointsize = 12, cex.pts = 1, 
              nlevels = 20, rkey = FALSE, 
              color.palette = terrain.colors, 
              vuni = FALSE, vmax = NULL, vxby = NULL, vyby = NULL, 
              axis.side = 1:2, minor.ticks = FALSE, 
              ticks.inside = FALSE)

Arguments

x
numeric; a vector of x coordinates for the plot. If x is a list, its components x$x, x$y, x$z, x$vx, and x$vy are used for x, y, <
y
numeric; a vector of y coordinates for the plot.
z
matrix; the state variable values to be plotted, NAs allowed (optional if type = "p").
vx
numeric; a vector of arrow component lengths in the x direction (optional).
vy
numeric; a vector of arrow component lengths in the y direction (optional).
type
character; a 1-character string giving the type of plot desired. The following values are possible: "p" for points, "l" for level contour, "g" for grid contour.
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.
xlab
character; the label for the x axis.
ylab
character; the label for the y axis.
zlab
character; the label for the z legend.
asp
numeric; the y/x aspect ratio.
csi
numeric; height of text characters in inches.
width
numeric; the width of the plotting window canvas in inches.
pointsize
integer; the point size of plotted text.
cex.pts
numeric; the amount by which point symbols should be magnified relative to the default.
nlevels
integer; number of contour levels desired.
rkey
logical; if TRUE the legend key is reversed with z values descending from top to bottom.
color.palette
function; a color palette to be used to assign colors in the plot.
vuni
logical; if TRUE all arrow lengths are set equal.
vmax
numeric; the maximum length of arrows in inches.
vxby
integer; increment for the sequence of arrows in the x direction.
vyby
integer; increment for the sequence of arrows in the y direction.
axis.side
integer; the side of the plot the axis is to be drawn on. The axis is placed as follows: 1 = below, 2 = left, 3 = above and 4 = right.
minor.ticks
logical; if TRUE minor tickmarks are added to the plot; its default is FALSE.
ticks.inside
logical; if TRUE tickmarks are placed inside the plot region; its default is FALSE.

See Also

filled.contour, image, arrows, AddAxis

Examples

Run this code
data(project)

d <- Data("data.pts")
PlotSurface2d(d, type = "p")

d <- Data("data.grd")
PlotSurface2d(d, type = "l")
PlotSurface2d(d, type = "g")

Run the code above in your browser using DataLab