Reputation: 7592
Is there any way to control the size of the strips on facets in a ggplot? I tried using strip.background=element_rect(size=n)
but as far as I can tell it didn't actually do anything. Is this even possible?
Upvotes: 11
Views: 4740
Reputation: 77096
converting the plot to a gtable manually lets you tweak the strip height,
library(ggplot2)
library(gtable)
d <- ggplot(mtcars, aes(x=gear)) +
geom_bar(aes(y=gear), stat="identity", position="dodge") +
facet_wrap(~cyl)
g <- ggplotGrob(d)
g$heights[[3]] = unit(1,"in")
grid.newpage()
grid.draw(g)
Upvotes: 10