The direction field is indicated variously, depending on the value of
drawDirectionField( x, y, u, v, scalex, scaley, skip, length = 0.05, add = FALSE, type = 1, col = par("fg"), pch = 1, cex = par("cex"), lwd = par("lwd"), lty = par("lty"), xlab = "", ylab = "", debug = getOption("oceDebug"), ... )
coordinates at which velocities are specified. The
scale to be used for the velocity arrows.
Exactly one of these must be specified. Arrows that have
either an integer, or a two-element vector indicating
the number of points to skip when plotting arrows (for the
indication of width of arrowheads. The
somewhat confusing name of this argument is a consequence of
the fact that it is passed to
indication of the style of arrow-like indication of the direction.
color of line segments or arrows; see
plot character and expansion factor, used for
line width and type, used for
debugging value; set to a positive integer to get debugging information.
other arguments to be passed to plotting functions (e.g. axis labels, etc).
type=1, each indicator is drawn with a symbol, according to the
pch (either supplied globally, or as an element of the
... list) and of size
cex, and color
col. Then, a
line segment is drawn for each, and for this
be set globally or in the
type=2, the points are not drawn, but arrows are drawn instead
of the line segments. Again,
col control the type of
## 2D example x <- seq(-2, 2, 0.1) y <- x xx <- expand.grid(x, y)[,1] yy <- expand.grid(x, y)[,2] z <- matrix(xx*exp(-xx^2 -yy^2), nrow=length(x)) gz <- grad(z, x, y) drawDirectionField(x, y, gz$gx, gz$gy, scalex=0.5, type=2, len=0.02)oceContour(x, y, z, add=TRUE)