Closed
Description
According to ?theme
, strip.switch.pad.grid
and strip.switch.pad.wrap
have the same effect, i.e. "space between strips and axes when strips are switched (unit)". My intuitive understanding was to use strip.switch.pad.wrap
with facet_wrap
and strip.switch.pad.grid
with facet_frid
. However this is wrong according to the reprex below:
library(ggplot2)
p <- ggplot(data = iris, aes(x = Sepal.Length, y = Petal.Length)) + theme(strip.placement = "outside")
p + facet_wrap(.~Species) + theme(strip.switch.pad.wrap = unit(10, "mm"))
p + facet_wrap(.~Species) + theme(strip.switch.pad.grid = unit(10, "mm"))
p + facet_grid(.~Species) + theme(strip.switch.pad.grid = unit(10, "mm"))
p + facet_grid(.~Species) + theme(strip.switch.pad.wrap = unit(10, "mm"))
Session info:
R version 4.0.5 (2021-03-31)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows 10 x64 (build 19042)
ggplot2 version 3.3.3