Learn R Programming

ocean (version 0.2-4)

image: Plot a fvcom.grid instance as a heatmap.

Description

Given a vector of data, this function plots the data as a heatmap on an unstructured grid. The length of the data vector must be as long as either the number nodes in the grid or the number of elements in the grid. The grid is currently stored as a data.frame, but will be converted to an S4 object in the future.

Arguments

x
A fvcom.grid instance.
z
A vector to plot as a heatmap.
units
Either 'll' for latitude and longitude or 'm' for meters.
col
A list of colors, such as that returned by bathy.colors.
add
Should the plot be added to the current plot? #'
xlim
x-limits for the plot.
ylim
y-limits for the plot.
zlim
z-limits for the plot.
border.col
Color of the element borders. If not provided the borders will be colored to match the adjacent polygons.
border.lwd
Line width of the element borders.
bg.col
Color of the background. The background is only plotted if add=F, otherwise bg.col is ignored.

Examples

Run this code
{
  op = par(ask=TRUE)
  # Plot the grid in a single color
  image(ocean.demo.grid, col='white')
  # Plot the grid in bathy colors
  image(ocean.demo.grid)
  par(op)
}

Run the code above in your browser using DataLab