addAxisLabels: Axis Ticks and Labels

View source: R/addAxisLabels.R

addAxisLabelsR Documentation

Axis Ticks and Labels

Description

Adds axis ticks, labels, and title to a graph.

Usage

addAxisLabels(which, current, title = "", ticks = FALSE,
  labels = TRUE)

Arguments

which

which axis to label, must be one of "bottom," "left," "top," or "right."

current

a list containing the current plot information, see Details.

title

the axis title.

ticks

draw the ticks.

labels

draw the labels.

Details

The current argument is generally the output from a high-level plotting function in smwrGraphs. If which is "left" or "right," then current must contain a component named yax. If which is "bottom" or "top," then current must containa component named xax. Those components are generally constructed from functions like linearPretty or or logPretty.

Value

The current plot information is returned invisibly.

Note

In general, all functions that create plots will draw the necessary axes. This function should be used only to add axis labels to an unlabeled axis. Axis labels can be suppressed by setting up the margins with negative values.

See Also

linearPretty, logPretty, datePretty, transPretty, addLabel

Examples

## Not run: 
set.seed(1)
X <- runif(25)
Y <- runif(25)
AA.pl <- xyPlot(X, Y)
addAxisLabels("top", AA.pl, labels=TRUE)
# For more details of addAxisLabels see 
vignette(topic="GraphSetup", package="smwrGraphs")

## End(Not run)

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