Learn R Programming

berryFunctions (version 1.5.2)

logAxis: label logarithmic axes

Description

shortcut to calling logVals, axis and abline

Usage

logAxis(from=-7, side=1, lcol="grey", lty=1, lwd=1, expr, logargs=NULL, las=1, ...)

Arguments

from
Lower exponent OR vector with data, as in logVals. DEFAULT: -7
side
which axis is to be labeled? DEFAULT: 1
lcol
Color of gridlines drawn in the graph with abline, NA to suppress. DEFAULT: "grey"
lty, lwd
Type of gridlines. DEFAULT: 1
expr
Expression drawing over the ablines, like (points(x,y). Can be code within {braces}.
logargs
List of arguments passed to logVals. DEFAULT: NULL
las
LabelAxisStyle for the orientation of the labels. DEFAULT: 1
...
further arguments passed to axis, like lwd, col.ticks, hadj, lty, ...

Value

  • An invisible list with
  • valsValues for lines and label positions
  • labsFormatted values for labels
  • allValues for lines

See Also

logVals, log10

Examples

Run this code
x <- 10^runif(200, -1, 2)
plot(x, 1:200, xaxt="n", log="x")
logAxis(x)
# overplot vertical lines:
logAxis(x, expr=points(x, 1:200), logargs=list(base=c(1,2,5)), col=2 )

Run the code above in your browser using DataLab