Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Inconsistent behavior of strip.switch.pad.grid and strip.switch.pad.wrap in ggplot 3.3.3 #4610

Closed
KleinWurm opened this issue Sep 9, 2021 · 0 comments · Fixed by #4669
Closed
Labels
bug an unexpected problem or unintended behavior facets 💎

Comments

@KleinWurm
Copy link

KleinWurm commented Sep 9, 2021


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

@KleinWurm KleinWurm changed the title Inconsistent behavior of strip.switch.pad.grid and strip.switch.pad.wrap strip.switch.pad.grid and strip.switch.pad.wrap beeing ignored in ggplot 3.3.3 Sep 9, 2021
@KleinWurm KleinWurm changed the title strip.switch.pad.grid and strip.switch.pad.wrap beeing ignored in ggplot 3.3.3 Inconsistent behavior of strip.switch.pad.grid and strip.switch.pad.wrap in ggplot 3.3.3 Sep 9, 2021
@thomasp85 thomasp85 added bug an unexpected problem or unintended behavior facets 💎 labels Oct 28, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug an unexpected problem or unintended behavior facets 💎
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants