Description Usage Arguments Value Examples
Calculate the position of major and minor ticks for a log10 axis.
1 |
x |
The values of the axis in question. |
log |
Logical indicating if x is already logarithmic. Defaults to
|
A list containing a vector each of the major and minor tick mark
positions which is intended to be used in conjuncton with axis
, see
examples.
1 2 3 4 5 6 7 8 9 | x <- 10^seq(1, 4, length.out = 100)
ticks <- log_ticks(x)
plot(x, stats::rnorm(100), log = "x", xaxt = "n")
axis(1, at = ticks$major_ticks)
axis(1, at = ticks$minor_ticks, labels = FALSE, tcl = -0.25)
# Use log = TRUE for input that is already logarithmic:
x2 <- log10(x)
ticks2 <- log_ticks(x2, log = TRUE)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.