library(oce)
# Flow from a point source
n <- 16
x <- rep(0, n)
y <- rep(0, n)
theta <- seq(0, 2*pi, length.out=n)
u <- sin(theta)
v <- cos(theta)
plotSticks(x, y, u, v, xlim=c(-2, 2), ylim=c(-2, 2))
rm(n, x, y, theta, u, v)
# Oceanographic example
if (require(ocedata)) {
data(met)
t <- ISOdatetime(met[["Year"]], met[["Month"]], met[["Day"]], 0, 0, 0, tz="UTC")
u <- met[["u"]]
v <- met[["v"]]
temperature <- met[["temperature"]]
oce.plot.ts(t, temperature, type='p', ylim=c(-5, 30))
plotSticks(t, 5, u, v, yscale=2, add=TRUE)
}
Run the code above in your browser using DataLab