I'm getting unpredictable behavior when using scales="free_y",
space="free". Take the following example:
da <- data.frame(
x=rep(1:5, 2),
y=c(1+(0:4), 1+(0:4)/10),
z=rep(1:2, each=5))
da
# x y z
#1 1 1.0 1
#2 2 2.0 1
#3 3 3.0 1
#4 4 4.0 1
#5 5 5.0 1
#6 1 1.0 2
#7 2 1.1 2
#8 3 1.2 2
#9 4 1.3 2
#10 5 1.4 2
qplot(x, y, data=da, group=z, geom="line") +
# scale_y_log10() +
facet_grid(z~., scales="free_y", space="free")
If the facet heights were proportional to their row ranges, the ratio
of the top to bottom facet heights (i.e., z=1 to z=2), should be (5-1)/
(1.4-1) = 4/0.4 = 10. The observed ratio in the resulting plot is
actually a lot smaller than that.
If you uncomment the log10 option, this problem looks worse: the two
heights now look the same! Instead, the heights ratio should be
log10(5)/log10(1.4) (since log10(1) = 0), i.e., 4.78.
Comments? I'm using R 2.9.1 and ggplot2 0.8.3.
Roberto
space = "free" if only meaningful if scales = "free", because when
scales = "fixed" all the scales are the same!
Hadley