Learn R Programming

oce (version 0.9-19)

plotProfile: Plot a CTD Profile

Description

Plot a profile, showing variation of some quantity (or quantities) with pressure, using the oceanographic convention of putting lower pressures nearer the top of the plot. This works for any oce object that has a pressure column in its data slot. The colours (col.salinity, etc.) are ony used if two profiles appear on a plot.

Usage

plotProfile(x, xtype = "salinity+temperature", ytype = c("pressure", "z", "depth", "sigmaTheta"), eos = getOption("oceEOS", default = "gsw"), lty = 1, xlab = NULL, ylab = NULL, col = "black", col.salinity = "darkgreen", col.temperature = "red", col.rho = "blue", col.N2 = "brown", col.dpdt = "darkgreen", col.time = "darkgreen", pt.bg = "transparent", grid = TRUE, col.grid = "lightgray", lty.grid = "dotted", Slim, Clim, Tlim, densitylim, N2lim, Rrholim, dpdtlim, timelim, plim, ylim, lwd = par("lwd"), xaxs = "r", yaxs = "r", cex = 1, pch = 1, useSmoothScatter = FALSE, df, keepNA = FALSE, type = "l", mgp = getOption("oceMgp"), mar = c(1 + if (length(grep("\\+", xtype))) mgp[1] else 0, mgp[1] + 1.5, mgp[1] + 1.5, mgp[1]), add = FALSE, inset = FALSE, debug = getOption("oceDebug"), ...)

Arguments

x
A ctd object, i.e. one inheriting from ctd-class.
xtype
Item(s) plotted on the x axis, either a vector of length equal to that of pressure in the data slot, or a text code from the list below.
list("salinity")
Profile of salinity.

list("conductivity")
Profile of conductivity.

list("temperature")
Profile of in-situ temperature.

list("theta")
Profile of potential temperature.

list("density")
Profile of density (expressed as $sigma_theta$).
list("index")
Index of sample (very useful for working with ctdTrim).

list("salinity+temperature")
Profile of salinity and temperature within a single axis frame.

list("N2")
Profile of square of buoyancy frequency $N^2$, calculated with swN2 with an optional argument setting of df=length(x[["pressure"]])/4 to do some smoothing.

list("density+N2")
Profile of sigma-theta and the square of buoyancy frequency within a single axis frame.

list("density+dpdt")
Profile of sigma-theta and dP/dt for the sensor. The latter is useful in indicating problems with the deployment. It is calculated by first differencing pressure and then using a smoothing spline on the result (to avoid grid-point wiggles that result because the SBE software only writes 3 decimal places in pressure). Note that dP/dt may be off by a scale factor; this should not be a problem if there is a time column in the data slot, or a sample.rate in the metadata slot.

list("spice")
Profile of spice

list("Rrho")
Profile of Rrho, defined in the diffusive sense

list("RrhoSF")
Profile of Rrho, defined in the salt-finger sense

an expression
an expression to be evaluated, in the calling environment, for some quantity; in this case, it makes sense to specify also xlab.

ytype
variable to use on y axis; note that z is the negative of depth.
eos
equation of state to be used, either "unesco" or "gsw".
lty
line type for the profile.
xlab
optional label for x axis (at top of plot).
ylab
optional label for y axis. Set to "" to prevent labelling the axis.
col
colour for a general profile.
col.salinity
colour for salinity profile (see “Details”).
col.temperature
colour for temperature (see “Details”).
col.rho
colour for density (see “Details”).
col.N2
colour for square of buoyancy frequency (see “Details”).
col.dpdt
colour for dP/dt.
col.time
colour for delta-time.
pt.bg
inside colour for symbols with pch in 21:25
grid
logical, set to TRUE to get a grid.
col.grid
colour for grid.
lty.grid
line type for grid.
Slim
Optional limit for S axis
Clim
Optional limit for conductivity axis
Tlim
Optional limit for T axis
densitylim
Optional limit for density axis
N2lim
Optional limit for N2 axis
Rrholim
Optional limit for Rrho axis
dpdtlim
Optional limit for dp/dt axis
timelim
Optional limit for delta-time axis
plim
Optional limit for pressure axis, ignored unless ytype=="pressure", in which case it takes precedence over ylim.
ylim
Optional limit for y axis, which can apply to any plot type, although is overridden by plim if ytype=="pressure".
lwd
lwd value for data line
xaxs
value of par xaxs to use
yaxs
value of par yaxs to use
cex
size to be used for plot symbols (see par)
pch
code for plotting symbol (see par).
useSmoothScatter
boolean, set to TRUE to use smoothScatter instead of plot to draw the plot.
df
optional argument, passed to swN2 if provided, and if a plot using $N^2$ is requested.
keepNA
FALSE
type
type of plot to draw, using the same scheme as plot.
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
Four-element numerical value to be used to set the plot margins, with a call to par(mar) prior to the plot. Note that the default value has enough margin space at the top for an axis (in the oceanographic convention) but the bottom margin will be too thin for an axis, if the value of which indicates a univariate plot (e.g. which="salinity", as opposed to which="salinity+temperature"). In such cases, any subsequent plots will have a par(mar)[1] value that will be too small to fit an an axis. A good solution is to simply transfer the existing (presumed acceptable) mar value, by using mar=par("mar").
add
A logical value that controls whether to add to an existing plot. (It makes sense to use add=TRUE in the panel argument of a coplot, for example.)
inset
A logical value indicating whether to draw an inset plot. Setting this to TRUE will prevent the present function from adjusting the margins, which is necessary because margin adjustment is the basis for the method used by plotInset.
debug
a flag that turns on debugging. Set to 1 to get a moderate amount of debugging information, or to 2 to get more.
...
optional arguments passed to other functions. A common example is to set df, for use in swN2 calculations.

Value

None.

See Also

read.ctd scans ctd information from a file, plot,ctd-method is a general plotting function for ctd objects, and plotTS plots a temperature-salinity diagrams.

Other functions that plot oce data: plot,adp-method, plot,adv-method, plot,amsr-method, plot,argo-method, plot,bremen-method, plot,cm-method, plot,coastline-method, plot,ctd-method, plot,gps-method, plot,ladp-method, plot,lisst-method, plot,lobo-method, plot,met-method, plot,odf-method, plot,rsk-method, plot,satellite-method, plot,sealevel-method, plot,section-method, plot,tidem-method, plot,topo-method, plot,windrose-method, plotScan, plotTS, tidem-class

Other things related to ctd data: [[,ctd-method, [[<-,ctd-method, as.ctd, cnvName2oceName, ctd-class, ctdAddColumn, ctdDecimate, ctdFindProfiles, ctdRaw, ctdTrim, ctdUpdateHeader, ctd, gps-class, handleFlags,ctd-method, plot,ctd-method, plotScan, plotTS, read.ctd.itp, read.ctd.odf, read.ctd.sbe, read.ctd.woce.other, read.ctd.woce, read.ctd, subset,ctd-method, summary,ctd-method, woceNames2oceNames, write.ctd

Examples

Run this code

library(oce)
data(ctd)
plotProfile(ctd, xtype="temperature")

Run the code above in your browser using DataLab