-
Notifications
You must be signed in to change notification settings - Fork 109
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add label_log()
#312
Add label_log()
#312
Conversation
That's a question for @hadley, but I'd probably keep the current default it since tons of code may depend on it. |
Ah, I see this function has been around for a long time. Ok - I can reverse that change. |
Can the concept of |
#' @examples | ||
#' demo_log10(c(1, 1e5), labels = label_log()) | ||
#' demo_log10(c(1, 1e5), breaks = breaks_log(base = 2), labels = label_log(base = 2)) | ||
label_log <- function(base = 10, digits = 3) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I changed digits
to 3 because I'd prefer not to rely on a global default (and 6 is usually going to be too many)
@clauswilke - as discussed in #311. Please let me know what you think.
The default behavior of
label_log()
is essentially an alias forlabel_math(expr = 10^.x, format = log10)
. But it also has abase
argument to support other logarithm bases (see examples below).Since the next release already contains breaking changes, I took the liberty of removing the default expression fromlabel_math()
. I don't see any reason for this default expression over any others. But please let me know if this change should be reverted.Created on 2021-06-24 by the reprex package (v2.0.0)