Closed bgreenwell closed 8 years ago
# Check if logged x-axis is required
dots <- list(...)
logx <- FALSE
if ("log" %in% names(dots)) {
if (grepl("x", dots$log)) {
logx <- TRUE
}
}
# Plot limits, labels, etc.
if (missing(xlim)) {
xlim <- range(xvals) # default limits for x-axis
}
ulim <- if (logx) {
log(xlim)
} else {
xlim
}
if (extend.range) {
ulim <- extendrange(ulim)
}
xgrid <- if (logx) {
list(exp(seq(from = ulim[1L], to = ulim[2L], length = n)))
} else {
list(seq(from = ulim[1L], to = ulim[2L], length = n))
}
Example:
Should be fixed by taking the log of
x
before extending the range.