I am trying to use ggplot2 to create a performance chart with a log normal y scale. Unfortunately I\'m not able to produce nice ticks as for the base plot function.
The base graphics function axTicks()
returns the axis breaks for the current plot. So, you can use this to return breaks identical to base graphics. The only downside is that you have to plot the base graphics plot first.
library(ggplot2)
library(scales)
plot(M, type="l",log="y")
breaks <- axTicks(side=2)
ggplot(M,aes(x=X,y=Y)) + geom_line() +
scale_y_continuous(breaks=breaks) +
coord_trans(y="log")