str(xscale.components.default(c(0, 1)))
set.seed(36872)
rln <- rlnorm(100)
densityplot(rln,
scales = list(x = list(log = 2), alternating = 3),
xlab = "Simulated lognormal variates",
xscale.components = function(...) {
ans <- xscale.components.default(...)
ans$top <- ans$bottom
ans$top$labels$labels <-
if (require(MASS))
fractions(2^(ans$top$labels$at))
else
2^(ans$top$labels$at)
ans
})Run the code above in your browser using DataLab