| oce.plot.sticks {oce} | R Documentation |
Draw a stick-plot diagram
oce.plot.sticks(x, y, u, v, yscale=1, add=FALSE, length=1/20, ...)
x |
x coordinates of stick origins. |
y |
y coordinates of stick origins. |
u |
x coordinates of stick lengths. |
v |
y coordinates of stick lengths. |
yscale |
scale from u and v to y (see “Details”). |
add |
boolean, set TRUE to add to an existing plot. |
length |
value to be provided to arrows; here, we set
a default that is smaller than normally used, because these plots tend
to be crowded in oceanographic applications. |
... |
graphical parameters passed down to arrows.
It is common, for example, to use smaller arrow heads than
arrows uses; see “Examples”. |
The arrows are drawn with directions on the graph that match
the directions indicated by the u and v components. The
arrow size is set relative to the units of the y axis,
according to the value of yscale, which has the unit of
v divided by the unit of y.
The interpretation of diagrams produced by oce.plot.sticks can
be difficult, owing to overlap in the arrows. For this reason, it It
is often a good idea to smooth u and v before using this
function.
Dan Kelley
library(oce)
data(air.hal)
attach(air.hal)
oce.plot.ts(t, temperature, type='l', ylim=c(0,25), ylab=resizable.label("T"))
oce.plot.sticks(t, rep(5, length(u)), u, v, yscale=2, add=TRUE)
legend("bottomright", legend="Velocity scale: 2 m/s per degC", bg="white")
detach(air.hal)