
fvcom.grid
class and overlay the
trajectories given by xy
.fvcom.grid
class and
overlay the trajectories given by xy
.
fvcom.grid
instancelist
with matrices x
and
y
components that contain the trajectories to
plot. The columns of xy$x
are plotted against the
columns of xy$y
, so each particle trajectory
should be in a column and each time index in a row.xy
. Either 'm' for
meters or 'll' for latitude and longitude.matlines
.{
# Create a set of random trajectories.
nodes = get.nodes(ocean.demo.grid)
set.seed(1)
x = apply(matrix(rnorm(1000, 0, 0.01), 250), 2, cumsum) - 69.5
y = apply(matrix(rnorm(1000, 0, 0.01), 250), 2, cumsum) + 42.5
lines(ocean.demo.grid, list(x=x, y=y), lty=1)
}
Run the code above in your browser using DataLab