ggplot:如何增加刻面图之间的间距? [英] ggplot: How to increase spacing between faceted plots?
本文介绍了ggplot:如何增加刻面图之间的间距?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我有几个多面直方图(用下面的命令获得),这些直方图很好地在另一个下面绘制。我想增加它们之间的间距,但是,它们很紧。
I have several faceted histograms (obtained with the command below) which are nicely plotted one under the other. I would like to increase the spacing between them, however, they are tight.
我看了 doc ,但没有找到这个参数。
I looked at the doc but didn't find a parameter for this.
预先感谢。
qplot (Happiness.Level, Number.of.Answers, data=mydata, geom="histogram") + facet_grid (Location ~ .)
推荐答案
使用主题功能:
library(grid)
p + theme(panel.spacing = unit(2, "lines"))
另请参阅:切割由ggplot2生成的图
这篇关于ggplot:如何增加刻面图之间的间距?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文