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.
I looked at the doc but didn't find a parameter for this.
Thanks in advance.
qplot (Happiness.Level, Number.of.Answers, data=mydata, geom="histogram") + facet_grid (Location ~ .)
Use the theme function:
library(grid) p + theme(panel.margin = unit(2, "lines"))
panel.margin is deprecated, use
p + theme(panel.spacing = unit(2, "lines"))
(For old versions of ggplot prior to 0.9.2, use
opts instead of
See also here: Slicing plots generated by ggplot2