The brute force way to do it is to define the labels manually:
library(ggplot2)
library(scales)
# Toy example:
DF <- data.frame(x = runif(100, 0.1, 10), y = rnorm(100))
ggplot(DF, aes(x = x, y = y)) + geom_point() +
scale_x_continuous(trans = log2_trans(),
breaks = 2^(-3:3),
labels = c("1/8", "1/4", "1/2", "1", "2", "4", "8"))
I don't see how you could switch math_format() in midstream and get it
to work (it may - I just don't see it). I tried an if-else
construction and an ifelse() construction for the labels argument but
neither worked for me.
Dennis
> --
> --
> You received this message because you are subscribed to the ggplot2 mailing
> list.
> Please provide a reproducible example:
>
https://github.com/hadley/devtools/wiki/Reproducibility
>
> To post: email
ggp...@googlegroups.com
> To unsubscribe: email
ggplot2+u...@googlegroups.com
> More options:
http://groups.google.com/group/ggplot2
>
> ---
> You received this message because you are subscribed to the Google Groups
> "ggplot2" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to
ggplot2+u...@googlegroups.com.
> For more options, visit
https://groups.google.com/groups/opt_out.