我试图应用这个解决方案(如何在ggplot中更改小平面上的条带大小?1)更改ggplot中小平面上的条带大小,我增加了高度大小
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(5,"in")
grid.newpage()
grid.draw(g)
Run Code Online (Sandbox Code Playgroud)
为什么它的工作方式不同?