Skip to content

plot_layout axis_titles = "collect" has unusual behaviour for non-square assemblies  #375

Description

@jack-davison

See examples below - when you have a perfect 3x3 grid you get a single ylab on the LHS, but when you have a missing panel you end up with two - one ylab centred on the top 2x3 area and then another for the bottom row, which does look a bit odd!

Is this expected behaviour for this option?

Cheers!

library(patchwork)

# I know this is deprecated, but it's the quickest way to get a ggplot2...
theplot <- ggplot2::qplot(iris$Sepal.Length) + ggplot2::labs(y = "Axis")
#> Warning: `qplot()` was deprecated in ggplot2 3.4.0.
#> This warning is displayed once every 8 hours.
#> Call `lifecycle::last_lifecycle_warnings()` to see where this warning was
#> generated.

# this is okay
wrap_plots(rep(list(theplot), 9), nrow = 3) +
  plot_layout(axes = "collect")

# this looks a bit weird
wrap_plots(rep(list(theplot), 8), nrow = 3) +
  plot_layout(axes = "collect", axis_titles = "collect")

Created on 2024-08-08 with reprex v2.1.1

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugan unexpected problem or unintended behavior

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions