Learn R Programming

oce (version 0.2-1)

plot.ctd: Plot seawater CTD data

Description

Plot a summary diagram for CTD data.

Usage

## S3 method for class 'ctd':
plot(x,
     which=1:4, 
     ref.lat=NaN,
     ref.lon=NaN, 
     grid=TRUE,
     col.grid="lightgray",
     lty.grid="dotted",
     coastline,
     Slim, 
     Tlim, 
     plim,
     densitylim, 
     dpdtlim,
     timelim,
     lonlim,
     latlim,
     latlon.pch=20,
     latlon.cex=1.5,
     latlon.col="red",
     cex=1,
     useSmoothScatter=FALSE,
     adorn=NULL,
     mgp=getOption("oceMgp"),
     mar=c(mgp[1]+1,mgp[1]+1,mgp[1]+1.5,mgp[1]+1),
     debug=getOption("oceDebug"),
     ...)

Arguments

x
A cdt object, e.g. as read by read.ctd.
which
list of desired plot types.
  • which=1orwhich="temperature+salinity"gives a combined profile of temperature and salinity
  • which=2orwhich="density+N2"gives a combined profile
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
colour for the grid.
lty.grid
line type for grid.
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)
cex
size to be used for plot symbols
useSmoothScatter
boolean, set to TRUE to use smoothScatter instead of plot to draw the plot.
adorn
list of expressions to be executed for the panels in turn, e.g. to adorn the plots. If the number matches the number of panels, then the strings are applied to the appropriate panels, as they are drawn from top-left to bottom-right. If onl
mgp
3-element numerical vector to use for par(mgp), and also for par(mar), computed from this. The default is tighter than the R default, in order to use more space for the data and less for the axes.
mar
value to be used with par("mar").
debug
set to TRUE to get debugging information during processing.
...
optional arguments passed to plotting functions. A common example is to set df, for use in swN2 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 more than one panel is drawn, then on exit from plot.ctd, the value of par will be reset to the value it had before the function call. However, if only one panel is drawn, the adjustments to par made within plot.ctd are left in place, so that further additions may be made to the plot.

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(coastlineSLE)
lonlim <- -(69 + c(52, 41) / 60)
latlim <- 47 + c(48, 58) / 60
# IAL = Ile aux Lievres
plot(ctd, which=c(1,2,3,5),
     coastline=coastlineSLE,
     adorn=expression({},{},{},{text(-69.72,47.85,'IAL',pos=4)}))

# 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(ctdTrim(ctd.raw, "range",
  parameters=list(item="index", from=130, to=350)), which=8)
# See results
ctdTrimmed <- ctdTrim(ctd.raw, "range",
  parameters=list(item="index", from=130, to=350))
plot(ctdTrimmed)

Run the code above in your browser using DataLab