Skip to contents

Plot a summary diagram for a tidal fit.

Usage

# S4 method for class 'tidem'
plot(
  x,
  which = 1,
  constituents = c("SA", "O1", "K1", "M2", "S2", "M4"),
  sides = NULL,
  col = "blue",
  log = "",
  mgp = getOption("oceMgp"),
  mar = c(mgp[1] + 1, mgp[1] + 1, mgp[2] + 0.25, mgp[2] + 1),
  ...
)

Arguments

x

a tidem object.

which

integer flag indicating plot type, 1 for stair-case spectral, 2 for spike spectral.

constituents

character vector holding the names of constituents that are to be drawn and labelled. If NULL, then no constituents will be shown.

sides

an integer vector of length equal to that of constituents, designating the side on which the constituent labels are to be drawn. As in all R graphics, the value 1 indicates the bottom of the plot, and 3 indicates the top. If sides=NULL, the default, then all labels are drawn at the top. Any value of sides that is not either 1 or 3 is converted to 3.

col

a character vector naming colors to be used for constituents. Ignored if sides=3. Repeated to be of the same length as constituents, otherwise.

log

if set to "x", the frequency axis will be logarithmic.

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").

...

optional arguments passed to plotting functions, not all of which are obeyed. For example, if ... contains type, that value will be ignored because it is set internally, according to the value of which.

Sample of Usage


library(oce)
data(sealevel)
tide <- tidem(sealevel)
plot(tide)

Historical note

An argument named labelIf was removed in July 2016, because it was discovered never to have worked as documented, and because the more useful argument constituents had been added.

Author

Dan Kelley