plot,ctd-method | R Documentation |
Plot CTD data in any of many different ways. In many cases, the best choice is to use default values for all parameters other than the first. This yields a 4-panel plot that displays a basic overview of the data, with a combined profile of salinity and temperature at the top left, a combined plot of density and the square of buoyancy frequency at top right, a TS diagram at bottom left, and a map at bottom right.
## S4 method for signature 'ctd'
plot(
x,
which,
col = par("fg"),
fill,
borderCoastline = NA,
colCoastline = "lightgray",
eos = getOption("oceEOS", default = "gsw"),
ref.lat = NaN,
ref.lon = NaN,
grid = TRUE,
coastline = "best",
Slim,
Clim,
Tlim,
plim,
densitylim,
sigmalim,
N2lim,
Rrholim,
dpdtlim,
timelim,
drawIsobaths = FALSE,
clongitude,
clatitude,
span,
showHemi = TRUE,
lonlabels = TRUE,
latlabels = TRUE,
latlon.pch = 20,
latlon.cex = 1.5,
latlon.col = "red",
projection = NULL,
cex = 1,
cex.axis = par("cex.axis"),
pch = 1,
useSmoothScatter = FALSE,
df,
keepNA = FALSE,
type,
mgp = getOption("oceMgp"),
mar = c(mgp[1] + 1.5, mgp[1] + 1.5, mgp[1] + 1.5, mgp[1] + 1),
inset = FALSE,
add = FALSE,
debug = getOption("oceDebug"),
...
)
x |
a ctd object. |
which |
a numeric or character vector specifying desired plot types. If
The details of individual
|
col |
color of lines or symbols. |
fill |
a legacy parameter that will be permitted only temporarily; see “History”. |
borderCoastline |
color of coastlines and international borders, passed
to |
colCoastline |
fill color of coastlines and international borders, passed
to |
eos |
character value indicating the equation of state to be used, either
|
ref.lat |
latitude of reference point for distance calculation. The permitted range is -90 to 90. |
ref.lon |
longitude of reference point for distance calculation. The permitted range is -180 to 180. |
grid |
logical value indicating whether to draw a grid on the plot. |
coastline |
a specification of the coastline to be used for
|
Slim , Clim , Tlim , plim , densitylim , sigmalim , N2lim , Rrholim , dpdtlim , timelim |
optional
numeric vectors of length 2, that give axis limits for salinity (or Absolute
Salinity, if |
drawIsobaths |
logical value indicating whether to draw depth contours on
maps, in addition to the coastline. The argument has no effect except
for panels in which the value of |
clongitude , clatitude , span |
controls for the map area view,
used only if |
showHemi , lonlabels , latlabels |
controls for axis labelling, used only if |
latlon.pch , latlon.cex , latlon.col |
controls for station location,
used only if |
projection |
controls the map projection (if any), and ignored unless
|
cex |
size to be used for plot symbols (see |
cex.axis |
size factor for axis labels (see |
pch |
code for plotting symbol (see |
useSmoothScatter |
logical value indicating whether to
use |
df |
optional numeric argument that is ignored except for plotting buoyancy
frequency; in that case, it is passed to |
keepNA |
logical value indicating whether |
type |
the type of plot to draw, using the same scheme as
|
mgp |
three-element numerical vector specifying axis-label geometry,
passed to |
mar |
four-element numerical vector specifying margin geometry,
passed to |
inset |
logical value indicating whether this
function is being used as an inset. The
effect is to prevent the present function from adjusting margins, which is
necessary because margin adjustment is the basis for the method used by
|
add |
logical value indicating whether to add to an existing plot. This
only works if |
debug |
an integer specifying whether debugging information is
to be printed during the processing. This is a general parameter that
is used by many |
... |
optional arguments passed to plotting functions. |
The
default values of which
and other arguments are chosen to be useful
for quick overviews of data. However, for detailed work it is common
to call the present function with just a single value of which
, e.g.
with four calls to get four panels. The advantage of this is that it provides
much more control over the display, and also it permits the addition of extra
display elements (lines, points, margin notes, etc.) to the individual panels.
Note that panels that draw more than one curve (e.g. which="salinity+temperature"
draws temperature and salinity profiles in one graph), the value of par("usr")
is established by the second profile to have been drawn. Some experimentation will
reveal what this profile is, for each permitted which
case, although
it seems unlikely that this will help much ... the simple fact is that drawing two
profiles in one graph is useful for a quick overview, but not useful for e.g. interactive
analysis with locator()
to flag bad data, etc.
January 2022:
Add ability to profile anything stored in the data
slot, and anything
that can be computed from information in that slot. The list of
possibilities is found by examining the data
and dataDerived
elements
of x[["?"]]
.
Drop the lonlim
and latlim
parameters, marked for removal in 2014;
use clongitude
, clatitude
and span
instead (see
plot,coastline-method()
).
February 2016:
Drop the fill
parameter for land colour; use colCoastline
instead.
Add the borderCoastline
argument, to control the colour of coastlines
and international boundaries.
Dan Kelley
The documentation for ctd explains the structure of CTD objects, and also outlines the other functions dealing with them.
Other functions that plot oce data:
download.amsr()
,
plot,adp-method
,
plot,adv-method
,
plot,amsr-method
,
plot,argo-method
,
plot,bremen-method
,
plot,cm-method
,
plot,coastline-method
,
plot,gps-method
,
plot,ladp-method
,
plot,landsat-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
,
plot,xbt-method
,
plotProfile()
,
plotScan()
,
plotTS()
,
tidem-class
Other things related to ctd data:
CTD_BCD2014666_008_1_DN.ODF.gz
,
[[,ctd-method
,
[[<-,ctd-method
,
as.ctd()
,
cnvName2oceName()
,
ctd
,
ctd-class
,
ctd.cnv.gz
,
ctdDecimate()
,
ctdFindProfiles()
,
ctdFindProfilesRBR()
,
ctdRaw
,
ctdRepair()
,
ctdTrim()
,
ctd_aml.csv.gz
,
d200321-001.ctd.gz
,
d201211_0011.cnv.gz
,
handleFlags,ctd-method
,
initialize,ctd-method
,
initializeFlagScheme,ctd-method
,
oceNames2whpNames()
,
oceUnits2whpUnits()
,
plotProfile()
,
plotScan()
,
plotTS()
,
read.ctd()
,
read.ctd.aml()
,
read.ctd.itp()
,
read.ctd.odf()
,
read.ctd.odv()
,
read.ctd.saiv()
,
read.ctd.sbe()
,
read.ctd.ssda()
,
read.ctd.woce()
,
read.ctd.woce.other()
,
setFlags,ctd-method
,
subset,ctd-method
,
summary,ctd-method
,
woceNames2oceNames()
,
woceUnit2oceUnit()
,
write.ctd()
# 1. simple plot
library(oce)
data(ctd)
plot(ctd)
# 2. how to customize depth contours
par(mfrow = c(1, 2))
data(section)
stn <- section[["station", 105]]
plot(stn, which = "map", drawIsobaths = TRUE)
plot(stn, which = "map")
data(topoWorld)
tlon <- topoWorld[["longitude"]]
tlat <- topoWorld[["latitude"]]
tdep <- -topoWorld[["z"]]
contour(tlon, tlat, tdep,
drawlabels = FALSE,
levels = seq(1000, 6000, 1000), col = "lightblue", add = TRUE
)
contour(tlon, tlat, tdep,
vfont = c("sans serif", "bold"),
levels = stn[["waterDepth"]], col = "red", lwd = 2, add = TRUE
)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.