Learn R Programming

oce (version 0.1-76)

plot.ctd: Plot seawater CTD data

Description

Plot a summary diagram for CTD data.

Usage

## S3 method for class 'ctd':
plot(x,ref.lat=NaN, ref.lon=NaN, 
  grid=TRUE, col.grid="lightgray",
  which=1:4, coastline,
  Slim, Tlim, plim, densitylim, dpdtlim, timelim,
  lonlim, latlim,
  latlon.pch=20, latlon.cex=1.5, latlon.col="red",
  \dots)

Arguments

x
A cdt object, e.g. as read by read.ctd.
ref.lat
Latitude of reference point for distance calculation
ref.lon
Longitude of reference point for distance calculation
grid
Set TRUE to get a grid on all plots.
col.grid
The color of the grid.
which
list of desired plot types. There are four panels in total, and the desired plots are place in these, in reading order. Which=1 gives a combined profile of temperature and salinity. which=2 gives a combined profile of sigma-theta
coastline
a coastline object, e.g. as read by read.coastline (ignored if no map plotted).
Slim
optional limits of salinity axes
Tlim
optional limits of temperature axes
plim
optional limits of pressure axes
densitylim
optional limits of density axis
dpdtlim
optional limits of dP/dt axis
timelim
optional limits of delta-time axis
lonlim
optional limits of longitude axis of map (ignored if no map plotted)
latlim
optional limits of latitude axis of map (ignored if no map plotted)
latlon.pch
pch for sample location (ignored if no map plotted)
latlon.cex
cex for sample location (ignored if no map plotted)
latlon.col
col for sample location (ignored if no map plotted)
...
optional arguments passed to plotting functions. A common example is to set df, for use in sw.N2 calculations.

Details

Creates a multi-panel summary plot of data measured in a CTD cast. The panels are controlled by the which argument. Normally, 4 panels are specified with the which, but it can also be useful to specify less than 4 panels, and then to draw other panels after this call.

If only 2 panels are requested, they will be drawn side by side.

If only one panel is drawn, par will not be altered, which means that you may follow this call with other plotting commands, and the results will appear on the plot (which is not the case for the multi-panel forms). This is very useful in trimming the data, e.g. you might do plot(ctd, which=8) and notice that downcast is between index 10 and 300; then try plot(ctd.trim(ctd, "index", 10, 300), which=8) to see if your guess is right, and thus gradually you can find good settings for trimming; see also plot.ctd.scan.

See Also

The profiles are plotted with plot.profile, and the TS diagram is plotted with plot.TS. CTD data can be created with as.ctd or read with read.ctd. Summaries of CTD data are provided by summary.ctd.

Examples

Run this code
library(oce)
data(ctd) 
plot(ctd)

data(coastline.sle)
lonlim <- -(69 + c(52, 41) / 60)
latlim <- 47 + c(48, 58) / 60
plot(ctd, which=c(1,2,3,5),coastline=coastline.sle,lonlim=lonlim,latlim=latlim)

# Trimming
data(ctd.raw)
plot(ctd.raw, which=8)
abline(v=100)
abline(v=120)
abline(v=130)
abline(v=350)
# The range 130 to 350 seems good, but you can narrow in
# by repeating the command below, with differing ranges.
plot(ctd.trim(ctd.raw, "index", 130:350), which=8)
# See results
ctd.trimmed <- ctd.trim(ctd.raw, "index", 130:350)
plot(ctd.trimmed)

Run the code above in your browser using DataLab