Skip to content

strip.placement = "outside" and strip.switch.pad.wrap don't work together perfectly for facet_wrap. #5935

Open
@junjunlab

Description

@junjunlab

strip.switch.pad.wrap doesn't work when strip.placement = "outside" and strip.position = "bottom":

library(ggplot2)
base <- ggplot(mtcars, aes(mpg, drat)) +
  geom_point()

base + facet_wrap(~cyl) +
  theme(strip.placement = "outside",
        strip.switch.pad.wrap = unit(0.1,"npc"))

image

strip will only be added on one panel when strip.position = "bottom/left":

base + facet_wrap(~cyl,strip.position = "bottom",
                  ncol = 2) +
  theme(strip.placement = "outside",
        strip.switch.pad.wrap = unit(0.1,"npc"))

image

base + facet_wrap(~cyl,strip.position = "left") +
  theme(strip.placement = "outside",
        strip.switch.pad.wrap = unit(0.1,"npc"))

image

It doesn't work when strip.position = "right":

base + facet_wrap(~cyl,strip.position = "right") +
  theme(strip.placement = "outside",
        strip.switch.pad.wrap = unit(0.1,"npc"))

image

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions