| axesLabels {plotfunctions} | R Documentation |
Format axes labels.
Description
Format axes labels. Wrapper around format
and axis.
Usage
axesLabels(
xmark = TRUE,
ymark = TRUE,
replace = NULL,
trim = TRUE,
big.mark = "",
decimal.mark = ".",
...
)
Arguments
xmark |
Logical: If set to TRUE (default), only the
extreme values of the x-axis are returned (pretty tickmark locations).
Alternatively, if |
ymark |
Logical: If set to TRUE (default), only the
extreme values of the y-axis are returned (pretty tickmark locations).
Alternatively, if |
replace |
Two-element list: The first element contains a vector with
patterns to be replaced using the function |
trim |
Logical: Argument to |
big.mark |
character: Argument to |
decimal.mark |
character: Argument to |
... |
Other parameters provided to |
Value
List with x-positions and associated string labels, and y-positions and associated string labels.
Examples
# default axes:
emptyPlot(-56, 1006)
# simplified axes:
emptyPlot(-56, 1006,
xmark=TRUE, ymark=TRUE, las=1)
# correction of minus symbol and thousand separator:
# (results in LaTeX errors when creating PDF version of help files)
## Not run:
emptyPlot(-56, 1006, axes=FALSE)
labs = axesLabels(big.mark=" ",
replace=list(old=c("-"),new=c("\U2212")) )
axis(1, at=labs$xat, labels=labs$xlab, las=1)
axis(2, at=labs$yat, labels=labs$ylab, las=1)
## End(Not run)
# custom axes labels:
labs2 = axesLabels(xmark=list(c(-56,-28,0), c("start", "center", "end")) )
axis(1, at=labs2$xat, labels=labs2$xlab, las=1,
col.axis=alpha(2), col=alpha(2), lwd=2,
line=-3)
# using other arguments for format:
labs3 = axesLabels(replace=NULL, trim=FALSE, scientific=TRUE)
axis(1, at=labs3$xat, labels=labs3$xlab, las=1,
line=-6)