Learn R Programming

ocean (version 0.2-4)

lines: Plot an instance of the fvcom.grid class and overlay the trajectories given by xy.

Description

Plot an instance of the fvcom.grid class and overlay the trajectories given by xy.

Arguments

x
A fvcom.grid instance
xy
A list 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.
plot.units
The units for plotting. Either 'm' for meters or 'll' for latitude and longitude.
xy.units
The units of xy. Either 'm' for meters or 'll' for latitude and longitude.
...
Additional arguments to be passed to matlines.

Examples

Run this code
{
# 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