which
.
"plot"(x, which = c(1, 2, 3, 99), eos, at = NULL, labels = TRUE, grid = FALSE, contourLevels = NULL, contourLabels = NULL, stationIndices, coastline = "best", xlim = NULL, ylim = NULL, zlim = NULL, map.xlim = NULL, map.ylim = NULL, clongitude, clatitude, span, projection = NULL, xtype = "distance", ytype = "depth", ztype = "contour", zbreaks = NULL, zcol = NULL, legend.loc = "bottomright", adorn = NULL, showStations = FALSE, showStart = TRUE, showBottom = TRUE, axes = TRUE, mgp, mar, col, cex, pch, debug, ...)
section
object, e.g. as created by as.section
or read.section
.par
is
not adjusted, which makes it easy to add to the plot with subsequent plotting
commands."gsw"
and "unesco"
.
If eos
is not supplied, it defaults to
getOption("oceEOS", default="gsw")
.NULL
(the default), the x axis will indicate the distance
of the stations from the first in the section. (This may give errors in the
contouring routine, if the stations are not present in a geographical order.)
If a list, then it indicates the values at which stations will be plotted.at
.TRUE
, points are drawn at data locations.station.indices=1:4
."best"
(the default) to pick
a variant that suits the scale, "coastlineWorld"
for the coarse
version that is provided by \href{https://CRAN.R-project.org/package=#1}{\pkg{#1}}oceoce,
"coastlineWorldMedium"
or "coastlineWorldFine"
for two
coastlines provided by the \href{https://CRAN.R-project.org/package=#1}{\pkg{#1}}ocedataocedata package, or "none"
, to avoid
drawing a coastline.ztype="image"
;
see also zbreaks
and zcol
.map.ylim
is
ignored if map.xlim
is provided.mapPlot
. If projection="automatic"
,
however, a projection is devised from the data, with stereographic
if
the mean latitude exceeds 70N and mollweide
otherwise."distance"
for
distance (in km) to the first point in the section, "track"
for distance
along the cruise track, "longitude"
, "latitude"
, or
"time"
. Note that if the x values are not in order, they will be put in
order (which may make no sense) and a warning will be printed."pressure"
for
pressure (in dbar, with zero at the surface) or "depth"
for depth (in m
below the surface, calculated from pressure with swDepth
)."contour"
for
contours, "image"
for an image (drawn with imagep
with
filledContours=TRUE
), or "points"
to draw points.
In the first two cases, the data must be gridded, with identical pressures at
each station.ztype="points"
or
"image"
. If not provided, reasonable default are used. If zlim
is given but breaks
is not given, then breaks
is computed to
run from zlim[1]
to zlim[2]
. If zcol
is a function,
it will be invoked with an argument equal to
1+length(zbreaks)
.legend
, or
set to the empty string to avoid plotting a legend.expression
or vector of expressions that contain
R code that is to be executed immediately after each panel of the plot.
If the number of expressions matches the number of panels, then the
expressions are used for the corresponding panels; otherwise, the
expression list is extended to match the number of panels (i.e.
to obtain length(which)
elements). Note that adorn
is a dangerous argument, because if the expressions contained
therein set up local storage, there is a chance of entirely
disrupting the plotting. For this reason, adorn
was
marked as defunct in June 2016, and will be removed entirely
after the July CRAN release. Users with existing code that uses
adorn
should simply plot the panels individually, and
use conventional R functions, e.g. lines
etc.,
after each panel, to achieve the desired effect. (See
oce-defunct
for notes on other deprecated or
defunct oce
features.)polygon
, which fills the space to the bottom, or lines
, which
draws lines from stations to the bottom, or points
, which draws points
at the bottom.par(mgp)
, and also for
par(mar)
, computed from this. If not provided, this defaults to
getOption("oceMgp")
.par("mar")
. If not provided,
a default is set up.par("col")
.par("cex")
.par("pch")
.oce
functions. Generally, setting debug=0
turns off the printing, while higher values suggest that more information
be printed. If debug
is not supplied, it defaults to
getOption("oceDebug")
.labcex=1
will increase the size of contour labels.which
, as follows.which=1
or "temperature"
for temperature contours (the default)
which=2
or "salinity"
for salinity contours
which=3
or "sigmaTheta"
for sigma-theta contours
which=4
or "nitrate"
for nitrate concentration contours
which=5
or "nitrite"
for nitrite concentration contours
which=6
or "oxygen"
for oxygen concentration contours
which=7
or "phosphate"
for phosphate concentration contours
which=8
or "silicate"
for silicate concentration contours
which=9
or "u"
for eastward velocity
which=10
or "uz"
for vertical derivative of eastward velocity
which=11
or "v"
for northward velocity
which=12
or "vz"
for vertical derivative of northward velocity
which=20
or "data"
for a dot for each data location
which=99
or "map"
for a location map
The y-axis for the contours is pressure, plotted in the conventional reversed
form, so that the water surface appears at the top of the plot. The x-axis is
more complicated. If at
is not supplied, then the routine calculates x
as the distance between the first station in the section and each of the other
stations. (This will produce an error if the stations are not ordered
geographically, because the contour
routine cannot handle
non-increasing axis coordinates.) If at
is specified, then it is taken
to be the location, in arbitrary units, along the x-axis of labels specified by
labels
; the way this works is designed to be the same as for
axis
.
section-class
explains the
structure of section objects, and also outlines the other functions dealing
with them.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,tidem-method
,
plot,topo-method
,
plot,windrose-method
,
plotProfile
, plotScan
,
plotTS
, tidem-class
Other things related to section
data: [[,section-method
,
[[<-,section-method
,
as.section
,
handleFlags,section-method
,
read.section
, section-class
,
sectionAddStation
,
sectionGrid
, sectionSmooth
,
sectionSort
, section
,
subset,section-method
,
summary,section-method
library(oce)
data(section)
sg <- sectionGrid(section)
## 1. AO3 section, default fields.
plot(section)
## 2. Gulf Stream
GS <- subset(section, 109<=stationId&stationId<=129)
GSg <- sectionGrid(GS, p=seq(0,2000,100))
plot(GSg, which=c(1,99), map.ylim=c(34,42))
par(mfrow=c(2,1))
plot(GS, which=1, ylim=c(2000, 0), ztype='points',
zbreaks=seq(0,30,2), pch=20, cex=3)
plot(GSg, which=1, ztype='image', zbreaks=seq(0,30,2))
par(mfrow=c(1,1))
## 3. Image, with coloured dots to indicate grid-data mismatch.
plot(GSg, which=1, ztype='image')
T <- GS[['temperature']]
col <- oce.colorsJet(100)[rescale(T, rlow=1, rhigh=100)]
points(GS[['distance']],GS[['depth']],pch=20,cex=3,col='white')
points(GS[['distance']],GS[['depth']],pch=20,cex=2.5,col=col)
Run the code above in your browser using DataLab