I'm producing a faceted plot like this:
This is accomplished with:
df = data.frame(val=rnorm(2005), class=c(rep(c('a','b'), 1000), rep('c', 5)))
qplot(val, ..count.., data=df, geom='density', fill=I('black')) +
opts(strip.text.y = theme_text()) +
# scale_y_continuous(breaks=seq(0, 999, by=50)) +
facet_grid(class ~ ., scale = "free", space = "free")
I intentionally do want the facets to be differently sized (taking up only as much vertical space as necessary) but maintain the same scale.
Now, there are some problems with this plot:
I'd like to impose a min height on each facet so that you can at least see the right label text and recognize the display as an empty density plot - currently, if I didn't know how I generated this plot, I would never have guessed what that artifact at the bottom was.
While the facets share the same scale, the y-axes don't share the same grids/ticks. I can force them to share the same grid by uncommenting the commented line, but then I'm manually calculating this - is there some way to just use the coarsest grid among any of the density plots?
Thanks in advance for any answers.