Get axis label for minorLogTicks
Usage
getAxisLabel(
i,
asValues,
logAxisType = c("normal", "flip", "pvalue"),
logBase,
base_limit = 2,
offset = 0,
symmetricZero = (offset > 0),
...
)Arguments
- i
numericaxis value- asValues
logicalindicating whether the value should be evaluated.- logAxisType
characterstring with the type of axis values:"normal": axis values as-is."flip": inverted axis values, for example where negative values should be displayed as negative log-transformed values."pvalue": for values transformed as-log10(pvalue)
- logBase
numericlogarithmic base- base_limit
numericvalue indicating the minimum value that should be written as an exponential.- offset
numericvalue of offset used for log transformation.- symmetricZero
logicalindicating whether negative values should be displayed as negative log-transformed values.- ...
additional arguments are ignored.
Details
This function is intended to be called internally by
jamba::minorLogTicks().
See also
Other jam practical functions:
breakDensity(),
call_fn_ellipsis(),
checkLightMode(),
check_pkg_installed(),
colNum2excelName(),
color_dither(),
exp2signed(),
isFALSEV(),
isTRUEV(),
jargs(),
kable_coloring(),
lldf(),
log2signed(),
middle(),
minorLogTicks(),
newestFile(),
printDebug(),
reload_rmarkdown_cache(),
renameColumn(),
rmInfinite(),
rmNA(),
rmNAs(),
rmNULL(),
setPrompt()
Examples
x <- log10(c(1, 2, 5, 10, 20, 50, 100, 200, 500))
getAxisLabel(x, asValues=TRUE, logBase=10)
#> [1] 1 2 5 10 20 50 100 200 500
x1exp <- c(1, 2, 3, 4, 5)
plot(1:6, main="exponential values")
for (i in seq_along(x1exp)) {
text(x=i, y=i + 0.2,
getAxisLabel(x1exp[i], asValues=FALSE, logBase=10))
}
x1exp <- c(-3:3)
plot(-3:3, main="log2 fold change values")
for (i in seq_along(x1exp)) {
text(x=i, y=i + 0.3 - 4,
getAxisLabel(x1exp[i],
logAxisType="flip",
asValues=TRUE, logBase=2))
}
x1exp <- c(1, 2, 3, 4, 5)
plot(1:6, main="P-value style")
for (i in seq_along(x1exp)) {
text(x=i, y=i + 0.2,
getAxisLabel(x1exp[i],
logAxisType="pvalue", asValues=FALSE, logBase=10))
}