So first of all, I'm entirely new to programming and R (one week in), so apologies in advance.
How would I format the y axis in the following fashion with ggplot2?:
- The number of intervals I want. (eg, 10, visually equidistant intervals)
- Logarithmic scale
- Exponents instead of scientific (I want 10¹,10²,10³ instead of 1e+01,1e+02,1e+03)
I can find the answers to some of these individual issues, but they don't work in conjunction.
Here's my graph. I don't know if this helps.
ggplot(dfm,aes(Strain,value))+ geom_bar(aes(fill=variable),stat="identity",position="dodge")
Bottom line is: Currently the y axis is: 1e+02,1e+05,1e+08 I want it to be: 10¹,10²,10³,10⁴,10⁵,10⁶,10⁷,10⁸,10⁹,10¹⁰
library(ggplot2);library(scales);df <- data.frame(x=1:100,y=10^(1:100));ggplot(df, aes(x,y)) + geom_point() + scale_y_log10(breaks = trans_breaks("log10", function(x) 10^x, n = 10), labels = trans_format("log10", math_format(10^.x)))
for example should get you close. Also read the help?scales::trans_breaks
etc. to see how to tune all this. – lukeA