oce.axis.POSIXct: Oce Version of axis.POSIXct

Description Usage Arguments Details Value Author(s) See Also

View source: R/oce.R

Description

A specialized variant of axis.POSIXct that produces results with less ambiguity in axis labels.

Usage

1
2
3
4
5
oce.axis.POSIXct(side, x, at, tformat, labels = TRUE, drawTimeRange,
  abbreviateTimeRange = FALSE, drawFrequency = FALSE, cex = par("cex"),
  cex.axis = par("cex.axis"), cex.main = par("cex.main"),
  mar = par("mar"), mgp = par("mgp"), main = "",
  debug = getOption("oceDebug"), ...)

Arguments

side

as for axis.POSIXct.

x

as for axis.POSIXct.

at

as for axis.POSIXct.

tformat

as format for axis.POSIXct for now, but may eventually have new features for multiline labels, e.g. day on one line and month on another.

labels

as for axis.POSIXct.

drawTimeRange

Optional indication of whether/how to draw the time range in the margin on the side of the the plot opposite the time axis. If this is not supplied, it defaults to the value returned by getOption("oceDrawTimeRange"), and if that option is not set, it defaults to TRUE. No time range is drawn if drawTimeRange is FALSE. If it is TRUE, the range will be shown. This range refers to range of the x axis (not the data). The format of the elements of that range is set by getOption("oceTimeFormat") (or with the default value of an empty string, if this option has not been set). The timezone will be indicated if the time range is under a week. For preliminary work, it makes sense to use drawTimeRange=TRUE, but for published work it can be better to drop this label and indicate something about the time in the figure caption.

abbreviateTimeRange

boolean, TRUE to abbreviate the second number in the time range, e.g. dropping the year if it is the same in the first number.

drawFrequency

boolean, TRUE to show the frequency of sampling in the data

cex

size of labels on axes; see par("cex").

cex.axis

see par("cex.axis").

cex.main

see par("cex.main").

mar

value for par(mar) for axis

mgp

value for par(mgp) for axis

main

title of plot

debug

a flag that turns on debugging. Set to 1 to get a moderate amount of debugging information, or to 2 to get more.

...

as for axis.POSIXct.

Details

The tick marks are set automatically based on examination of the time range on the axis. The scheme was devised by constructing test cases with a typical plot size and font size, and over a wide range of time scales. In some categories, both small tick marks are interspersed between large ones.

The user may set the format of axis numbers with the tformat argument. If this is not supplied, the format is set based on the time span of the axis:

It should be noted that this scheme differs from the R approach in several ways. First, R writes day names for some time ranges, in a convention that is seldom seen in the literature. Second, R will write nn:mm for both HH:MM and MM:SS, an ambiguity that might confuse readers. Third, the use of both large and small tick marks is not something that R does.

Bear in mind that tformat may be set to alter the number format, but that the tick mark scheme cannot (presently) be controlled.

Value

A vector of times corresponding to axis ticks is returned silently.

Author(s)

Dan Kelley

See Also

This is used mainly by oce.plot.ts.


oce documentation built on May 29, 2017, 12:19 p.m.

Search within the oce package
Search all R packages, documentation and source code