Created
May 17, 2019 21:00
-
-
Save dwhdai/72f957e5d95db92fa94f4f6fc6d015c1 to your computer and use it in GitHub Desktop.
ggplot2 quick axis labels using scales
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
plot <- ggplot(...) | |
# Log 10 transformation | |
plot + | |
scale_x_continuous(trans = "log10", | |
breaks = scales::trans_breaks("log10", function(x)10^x), | |
labels = scales::trans_format("log10", scales::math_format(10^.x))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment