% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/ctd.R
\name{plotProfile}
\alias{plotProfile}
\title{Plot a ctd Profile}
\usage{
plotProfile(
  x,
  xtype = "salinity+temperature",
  ytype = "pressure",
  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,
  sigmalim,
  N2lim,
  Rrholim,
  dpdtlim,
  timelim,
  plim,
  xlim,
  ylim,
  lwd = par("lwd"),
  xaxs = "r",
  yaxs = "r",
  cex = 1,
  pch = 1,
  useSmoothScatter = FALSE,
  df,
  keepNA = FALSE,
  type = "l",
  mgp = getOption("oceMgp"),
  mar,
  add = FALSE,
  inset = FALSE,
  debug = getOption("oceDebug", 0),
  ...
)
}
\arguments{
\item{x}{a \linkS4class{ctd} object.}

\item{xtype}{item(s) to be plotted on the x axis, either a character
value taken from the following list, or a numeric vector of length
matching the \code{pressure} field stored in \code{x}. (In the second case,
as of version 1.7-11, a label is auto-constructed, unless the user
supplied a character value for \code{xlab}.)
\itemize{
\item \code{"salinity"} Profile of salinity.
\item \code{"conductivity"} Profile of conductivity.
\item \code{"temperature"} Profile of \emph{in-situ} temperature.
\item \code{"theta"} Profile of potential temperature.
\item \code{"density"} Profile of density (expressed as \eqn{\sigma_\theta}{sigma_theta}).
\item \code{"index"} Index of sample (useful for working with \code{\link[=ctdTrim]{ctdTrim()}}).
\item \code{"salinity+temperature"} Profile of salinity and temperature within a single axis frame.
\item \code{"N2"} Profile of square of buoyancy frequency \eqn{N^2}{N^2},
calculated with \code{\link[=swN2]{swN2()}} with
an optional argument setting of \code{df=length(x[["pressure"]])/4} to do
some smoothing.
\item \code{"density+N2"} Profile of sigma0 and
the square of buoyancy frequency within a single axis frame.
\item \code{"density+dpdt"} Profile of sigma0 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
\code{time} column in the \code{data} slot, or a \code{sample.rate} in the
\code{metadata} slot.
\item \code{"sigma0"}, \code{"sigma1"}, \code{"sigma2"}, \code{"sigma3"}
and \code{"sigma4"} Profile of potential density referenced
to 0dbar (i.e. the surface), 1000dbar, 2000dbar, 3000dbar, and 4000dbar.
\item \code{"spice"}, \code{"spiciness0"} \code{"spiciness1"} or \code{"spiciness2"}
Profile of named quantity.  For \code{spice}, \code{\link[=swSpice]{swSpice()}} is
called with the \code{eos} argument set to \code{"unesco"}. Otherwise,
\code{\link[gsw:gsw_spiciness0]{gsw::gsw_spiciness0()}}', \code{\link[gsw:gsw_spiciness1]{gsw::gsw_spiciness1()}}' or
\code{\link[gsw:gsw_spiciness2]{gsw::gsw_spiciness2()}}' is called.
\item \code{"Rrho"} Profile of Rrho, defined in the diffusive sense.
\item \code{"RrhoSF"} Profile of Rrho, defined in the salt-finger sense.
}}

\item{ytype}{variable to use on y axis. The valid choices are:
\code{"pressure"} (the default), \code{"z"},
\code{"depth"}, \code{"sigmaTheta"} and \code{"sigma0"}.}

\item{eos}{equation of state to be used, either \code{"unesco"} or
\code{"gsw"}.}

\item{lty}{line type for the profile.}

\item{xlab}{optional label for x axis (at top of plot). If not
provided, a label is inferred from the value of \code{xtype}. For
the user-supplied case, bear in mind that the easy way to get
units is to use an expression, e.g.
\code{xlab=expression("Acceleration ["*m/s^2*"]")}.}

\item{ylab}{optional label for y axis.  See \code{xlab} for a note on
units.  Setting \code{ylab=""} prevents labelling the axis.}

\item{col}{color for a general profile.}

\item{col.salinity}{color for salinity profile (see \dQuote{Details}).}

\item{col.temperature}{color for temperature (see \dQuote{Details}).}

\item{col.rho}{color for density (see \dQuote{Details}).}

\item{col.N2}{color for square of buoyancy frequency (see
\dQuote{Details}).}

\item{col.dpdt}{color for dP/dt.}

\item{col.time}{color for delta-time.}

\item{pt.bg}{inside color for symbols with \code{pch} in 21:25}

\item{grid}{logical, set to \code{TRUE} to get a grid.}

\item{col.grid}{color for grid.}

\item{lty.grid}{line type for grid.}

\item{Slim}{optional limit for the salinity axis, which can either
represent Practical Salinity or Absolute Salinity.}

\item{Clim}{optional limit for the conductivity axis.}

\item{Tlim}{optional limit for the temperature axis, which
can represent in-situ temperature, potential temperature, or
Conservative Temperature.}

\item{densitylim}{optional limit for density axis.}

\item{sigmalim}{optional limit for the density-anomaly
axis, which can represent \code{sigmaTheta}, \code{sigma0}, \code{sigma1},
\code{sigma2}, \code{sigma3} or \code{sigma4}.}

\item{N2lim}{optional limit for the N2 axis.}

\item{Rrholim}{optional limit for the density ratio axis.}

\item{dpdtlim}{optional limit for the dp/dt axis.}

\item{timelim}{optional limit for the delta-time axis.}

\item{plim}{optional limit for the pressure axis, ignored unless
\code{ytype=="pressure"}, in which case it takes precedence over
\code{ylim}.}

\item{xlim}{optional limit for x axis, which can apply to any plot type.
This is ignored if the plotted x variable is something for which a limit
may be specified with an argument, e.g. \code{xlim} is ignored for a
salinity profile, because \code{Slim} ought to be given in such a case.}

\item{ylim}{optional limit for y axis, which can apply to any plot type,
although is overridden by \code{plim} if \code{ytype} is \code{"pressure"}
or by \code{densitylim} if \code{ytype} is \code{"sigmaTheta"}.}

\item{lwd}{line width value for data line}

\item{xaxs}{value of \code{\link[=par]{par()}} \code{xaxs} to use}

\item{yaxs}{value of \code{\link[=par]{par()}} \code{yaxs} to use}

\item{cex}{size to be used for plot symbols (see \code{\link[=par]{par()}})}

\item{pch}{code for plotting symbol (see \code{\link[=par]{par()}}).}

\item{useSmoothScatter}{boolean, set to \code{TRUE} to use
\code{\link[=smoothScatter]{smoothScatter()}} instead of \code{\link[=plot]{plot()}} to draw the plot.}

\item{df}{optional argument, passed to \code{\link[=swN2]{swN2()}} if provided, and
if a plot using \eqn{N^2}{N^2} is requested.}

\item{keepNA}{FALSE}

\item{type}{type of plot to draw, using the same scheme as
\code{\link[=plot]{plot()}}.}

\item{mgp}{3-element numerical vector to use for \link{par}\code{(mgp)}, and also
for \link{par}\code{(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.}

\item{mar}{Four-element numerical value to be used to set the plot
margins, with a call to \link{par}\code{(mar)} prior to the plot.
If this is not supplied, a reasonable default will be set up.}

\item{add}{A logical value that controls whether to add to an existing plot.  (It
makes sense to use \code{add=TRUE} in the \code{panel} argument of a
\code{\link[=coplot]{coplot()}}, for example.)}

\item{inset}{A logical value indicating whether to draw an inset plot.
Setting this to \code{TRUE} will prevent the present function from adjusting
the margins, which is
necessary because margin adjustment is the basis for the method used by
\code{\link[=plotInset]{plotInset()}}.}

\item{debug}{a flag that turns on debugging.  Set to 1 to get a moderate
amount of debugging information, or to 2 to get more.}

\item{\dots}{optional arguments passed to other functions.  A common example
is to set \code{df}, for use in \code{\link[=swN2]{swN2()}} calculations.}
}
\value{
None.
}
\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 \code{oce} object that has a
pressure column in its \code{data} slot.
The colors (\code{col.salinity}, etc.) are only used if two profiles appear
on a plot.
}
\examples{
library(oce)
data(ctd)
plotProfile(ctd, xtype = "temperature")

}
\seealso{
\code{\link[=read.ctd]{read.ctd()}} scans ctd information from a file,
\code{\link[=plot,ctd-method]{plot,ctd-method()}} is a general plotting function for \code{ctd}
objects, and \code{\link[=plotTS]{plotTS()}} plots a temperature-salinity diagrams.

Other functions that plot oce data: 
\code{\link{plot,adp-method}},
\code{\link{plot,adv-method}},
\code{\link{plot,amsr-method}},
\code{\link{plot,argo-method}},
\code{\link{plot,bremen-method}},
\code{\link{plot,cm-method}},
\code{\link{plot,coastline-method}},
\code{\link{plot,ctd-method}},
\code{\link{plot,gps-method}},
\code{\link{plot,ladp-method}},
\code{\link{plot,landsat-method}},
\code{\link{plot,lisst-method}},
\code{\link{plot,lobo-method}},
\code{\link{plot,met-method}},
\code{\link{plot,odf-method}},
\code{\link{plot,rsk-method}},
\code{\link{plot,satellite-method}},
\code{\link{plot,sealevel-method}},
\code{\link{plot,section-method}},
\code{\link{plot,tidem-method}},
\code{\link{plot,topo-method}},
\code{\link{plot,windrose-method}},
\code{\link{plot,xbt-method}},
\code{\link{plotScan}()},
\code{\link{plotTS}()}

Other things related to ctd data: 
\code{\link{CTD_BCD2014666_008_1_DN.ODF.gz}},
\code{\link{[[,ctd-method}},
\code{\link{[[<-,ctd-method}},
\code{\link{argo2ctd}()},
\code{\link{as.ctd}()},
\code{\link{cnvName2oceName}()},
\code{\link{ctd}},
\code{\link{ctd-class}},
\code{\link{ctd.cnv.gz}},
\code{\link{ctdDecimate}()},
\code{\link{ctdFindProfiles}()},
\code{\link{ctdFindProfilesRBR}()},
\code{\link{ctdRaw}},
\code{\link{ctdRepair}()},
\code{\link{ctdTrim}()},
\code{\link{ctd_aml_type1.csv.gz}},
\code{\link{ctd_aml_type3.csv.gz}},
\code{\link{d200321-001.ctd.gz}},
\code{\link{d201211_0011.cnv.gz}},
\code{\link{handleFlags,ctd-method}},
\code{\link{initialize,ctd-method}},
\code{\link{initializeFlagScheme,ctd-method}},
\code{\link{oceNames2whpNames}()},
\code{\link{oceUnits2whpUnits}()},
\code{\link{plot,ctd-method}},
\code{\link{plotScan}()},
\code{\link{plotTS}()},
\code{\link{read.ctd}()},
\code{\link{read.ctd.aml}()},
\code{\link{read.ctd.itp}()},
\code{\link{read.ctd.odf}()},
\code{\link{read.ctd.odv}()},
\code{\link{read.ctd.saiv}()},
\code{\link{read.ctd.sbe}()},
\code{\link{read.ctd.ssda}()},
\code{\link{read.ctd.woce}()},
\code{\link{read.ctd.woce.other}()},
\code{\link{setFlags,ctd-method}},
\code{\link{subset,ctd-method}},
\code{\link{summary,ctd-method}},
\code{\link{woceNames2oceNames}()},
\code{\link{woceUnit2oceUnit}()},
\code{\link{write.ctd}()}
}
\author{
Dan Kelley
}
\concept{functions that plot oce data}
\concept{things related to ctd data}
