View source: R/addAxisLabels.R
addAxisLabels | R Documentation |
Adds axis ticks, labels, and title to a graph.
addAxisLabels(which, current, title = "", ticks = FALSE, labels = TRUE)
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. |
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
.
The current plot information is returned invisibly.
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.
linearPretty
, logPretty
,
datePretty
, transPretty
, addLabel
## 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)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.