bathymetry: Display Bathymetry

View source: R/bathymetry.R

bathymetryR Documentation

Display Bathymetry

Description

This function is used to display bathymetry (water depth) and isobath lines on a map. The data may be displayed in Digital Elevation Map (i.e. as an image) and/or contour lines which show the lines of water depth.

This function uses the image function to display Digital Elevation Map (DEM) and the contour function to derive the bathymetry lines from the DEM data. The DEM image changes colours at each value defined by the ‘breaks’ argument, while contour lines are drawn at each value in the ‘levels’ argument.

Usage

bathymetry(
  dem = TRUE,
  dem.col = c("lightblue", "deepskyblue4"),
  breaks = c(-5000, -4000, -3000, -2000, seq(-1000, 0, by = 50)),
  contour = TRUE,
  contour.col = c("skyblue", "skyblue2"),
  contour.lwd = c(0.4, 0.6),
  contour.cex = c(0.4, 0.5),
  levels = list(minor = seq(0, -200, by = -10), major = seq(0, -5000, by = -50)),
  x = NULL,
  y = NULL,
  z = NULL,
  ...
)

Arguments

dem

Logical value stating whether or not the Digital Elevation Map (DEM) image is to be plotted.

dem.col

Vector of colours to be used in drawing the Digital Elevation Map. A colour scale is interpolated between the pair of specified colours, or if a single colour is specified, the interpolation is made between ‘white’ and the specified colour.

breaks

A numeric vector of values specifying at which bathymetric values the DEM map is to change colour, as given by the interpolated colour scale generated from ‘dem.col’.

contour

Logical value stating whether or not to draw bathymetry contour lines.

contour.col

Vector of colours to be used in drawing the bethymetry contour lines. A colour scale is interpolated between the pair of specified colours, or if a single colour is specified, the interpolation is made between ‘white’ and the specified colour.

contour.lwd

A vector of line width(s) to be used for bathymetry lines. Either one or two numeric values may be passed.

contour.cex

Contour label size(s) to be used for bathymetry lines. Either one or two numeric values may be passed.

levels

A numeric vector or a list of two numeric vectors specifying the levels at which contour lines are to be drawn. When a list is given, the first is used to plot minor lines and the second is used to draw major lines.

x

A numeric vector specifying the horizontal locations of the DEM data specified by z. Either the length of x itself or the product of length(x) and length(y) must be the same as that of z.

y

A numeric vector specifying the vertical locations of the DEM data specified by z. Either the length of y itself or the product of length(x) and length(y) must be the same as that of z.

z

A numeric vector, a numeric matrix or a ‘SpatialGridDataFrame’ object specifying the Digital Elevation Map (DEM) values to be used by the bathymetry function. This alternate specification the DEM will be used instead of the internal call to data(gulf.dem).

...

Further arguments to be passed to other functions.

Value

No value is returned.

Examples

# Draws the bathymetry for the current window:
map()
bathymetry()
coast()
box()

# Draw only red contour lines at every 10 meters:
map()
bathymetry(dem = FALSE, contour.col = "red", levels = seq(-500, 0, by = 10))


TobieSurette/gulf.spatial documentation built on Sept. 26, 2024, 7:41 p.m.