Search code examples
rggplot2facet-wrapfacet-grid

Edit distance between the facet / strip and the plot


For example,

library(ggplot2)
ggplot(mpg, aes(displ, cty)) + geom_point() + facet_grid(cols = vars(drv))

enter image description here How can I change the distance between the strip and the main plot? (For example, create a gap between the strip and the main plot.)
But I don't need to change the strip size (different from this edit strip size ggplot2).


Solution

  • There is a much simpler solution

    theme(strip.placement = "outside")