Is there a simpler way of doing a log10 plot but without scientific
notation like below?
and secondly, is there any possibility of doing the facet with scales='free_y' ?
Thanks,
Sean
############################
#
# create a fake dataset
#
require(ggplot2)
x1 <- seq(from=-4, to=2)
df1 <- data.frame(x=x1, y=10^x1)
df2 <- df1
df1$p <- 'red'
df2$p <- 'green'
df2$y <- df2$y / 100
df <- rbind(df1,df2)
df$q <- c('a','b')
rm(df1,df2,x1)
# now given the fake dataset above... do a "pretty" non-scientific
log10() y-scale
t0 <- floor(log10(range(df$y)))
t1 <- seq(from=t0[1], to=t0[2])
qplot(x, y, data=df, geom='line') +
facet_grid(p ~ q) +
scale_y_log10(breaks=10^t1, labels=format(10^t1, big.mark=',',
scientific=FALSE, trim=TRUE, drop0trailing=T))
Not currently.
> and secondly, is there any possibility of doing the facet with scales='free_y' ?
facet_grid(p ~ q, scales = "free_y") ?
Hadley