Learn R Programming

RSurvey (version 0.5.0)

plotSurvey2d: Plot Points or Interpolated Surface

Description

Draws a scatter plot with arrows 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

plotSurvey2d(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)

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, z
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

See Also

filled.contour, image, arrows

Examples

Run this code
data(project)

d <- srvy.dat("data.pts")
plotSurvey2d(d, type = "p")

d <- srvy.dat("data.grd")
plotSurvey2d(d, type = "l")
plotSurvey2d(d, type = "g")

Run the code above in your browser using DataLab