Ggplot: How to increase the distance between faces?

I have several faceted histograms (obtained using the command below) that are beautifully built one below the other. I would like to increase the distance between them, however they are tight.

I looked through the doc but did not find for this parameter.

Thanks in advance.

qplot (Happiness.Level, Number.of.Answers, data=mydata, geom="histogram") + facet_grid (Location ~ .) 
+66
r ggplot2
Sep 10 2018-10-10T00:
source share
1 answer

Use the theme function:

 library(grid) p + theme(panel.spacing = unit(2, "lines")) 

See also here: Slices created by ggplot2

+89
Sep 10 '10 at 7:20
source share



All Articles