Hey everyone,

I'm having a little trouble with ggplot. I have two sets of y-values, one
whose range is contained in the other. Due to the nature of the y-values, I
wish to scale the y axis with a log base two transformation. Furthermore, I
wish to plot the two sets of y-values as boxplots in separate graphs with
the same ylim (and thus with the same ticks and tick labels). As of now, I
have:
ggplot(data, aes(x1, y1))+geom_boxplot()+scale_y_log2()
ggplot(data, aes(x2, y2))+geom_boxplot()+scale_y_log2()
which successfully creates the boxplot and transforms the y-axis. However, I
can't figure out how to change the range of the y-axis so that they're the
same in both graphs. Inserting "+scale_y_continuous(limits=c(...))" before
or after "+scale_y_log2()" doesn't seem to work. I also tried:
qplot(x1,y1,geom="boxplot", ylim=c(...))+scale_y_log2()
but my efforts were in vain. Any ideas?

Thanks.

Cheers,
Godwin

        [[alternative HTML version deleted]]

______________________________________________
[email protected] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Reply via email to