考虑以下示例?ggplot2::facet_grid
:
p <- ggplot(mpg, aes(displ, cty)) + geom_point()
p + facet_grid(vars(drv), vars(cyl))
Which results in the following image
What I would like to achieve is a minor offset/white space between the facet-labeling strip
s and the actual plots. The result would look (sans the gimp
involvement):
是否可以使用ggplot2
或其任何衍生包?
感谢您的任何见解。
遵循上面@Tung的回答(以及一些忽略文档的实验),我让它工作:
p <- ggplot(mpg, aes(displ, cty)) + geom_point()
p +
facet_grid(vars(drv), vars(cyl)) +
theme(strip.switch.pad.grid = unit(0.2, "cm"), strip.placement = "outside")
还有...... tada!:
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)