Load libraries
library(ggplot2) #Version 2.2.1
library(gtable)
Build plot
d <- ggplot(mtcars, aes(x=gear)) +
geom_bar(aes(y=gear), stat="identity", position="dodge") +
facet_wrap(~cyl)
Aim: change height of strip text
g <- ggplotGrob(d)
g$heights[[3]] = unit(2,"in")
g$grobs[[5]]$heights <- g$grobs[[6]]$heights <-
g$grobs[[7]]$heights <- unit(1, "native") # or "npc"
grid.newpage()
Expected result (as per the old ggplot 2.1.0)
Problem: Obtained result (in ggplot2 2.2.1)
The above solution is from here and worked fine in ggplot2 version 2.1.0.
How then should the strip background height modification be done in ggplot2 V 2.2.1? Many thanks folks!