Skip to content

[Feature Request]: collect_strip_text option for plot_layout() #471

Description

@mvanaman

Patchwork is so awesome!

I was wondering if it would be easy to add an option to collect the strip text (or facet labels, whatever you want to call them) on faceted plots combined with patchwork. For example, notice the redundant strip text (setosa, versicolor, virignica):

library(ggplot2)
library(patchwork)
p1 <- ggplot(iris, aes(x = Petal.Width, y = Petal.Length)) +
  geom_point() +
  facet_wrap(~ Species)
p2 <- ggplot(iris, aes(x = Petal.Width, y = Sepal.Length)) +
  geom_point() +
  facet_wrap(~ Species)
p1 / p2 +
  plot_layout(axes = "collect")

An easy workaround for simple cases like this is to just remove the strip text on the bottom plot before patchworking:

# current workaround:
p2 <- p2 +
  theme(strip.text = element_blank())
p1 / p2 +
  plot_layout(axes = "collect")

Created on 2026-07-04 with reprex v2.1.1

But if you have a bunch of plots, it's easy to lose track of individual plots, and kinda tedious to go find where you need to individually remove the strip text. It'd be nice to be able to just hand this task off to plot_layout() at the end!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions