setRtMargin: Set Secondary Margin

View source: R/setRtMargin.R

setRtMarginR Documentation

Set Secondary Margin

Description

Sets the right or top margin for graphs with secondary axes. Used After setting up the graphics environment, but before the call to the high-level graphics function to allocate space for an additional label and title.

Usage

setRtMargin(y, margin = c(NA, NA, NA, NA), right.labels = 7,
  right.log = FALSE, right.range = c(NA, NA))

setTopMargin(margin = c(NA, NA, NA, NA))

Arguments

y

the secondary y-axis data to be plotted, missing values are permitted and are ignored.

margin

incomplete plot margin specification, generally computed by setGraph.

right.labels

set up right-axis labels; the approximate number of labels.

right.log

logical, if TRUE, then log transform right axis.

right.range

set right-axis range.

Details

The values for right.labels, right.log, and right.range should be set exactly as in the call to addXY.

The margin is a numeric vector of length 4 specifying the bottom, left, top, and right margins around the plot, as decriibed in by the mar option in par. The function setTopMargin only changes the third value and the function setRtMargin only changes the fourth value. The value for margin is typically the output from setGraph or the defaults for these functions.

Value

The updated margin; only the right margin value is changed.

See Also

setLayout, setGraph, addXY

Examples

## Not run: 
# See for examples of setRtMargin:
demo(topic="RightAxisExample", package="smwrGraphs")
# See for examples of setTopMargin:
demo(topic="TopAxisExample", package="smwrGraphs")

## End(Not run)

USGS-R/smwrGraphs documentation built on Oct. 11, 2022, 6:11 a.m.