You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It looks like the plot_layout(axes = "collect") does not work when one of the plots has a facet_wrap that has multiple rows.
Take the following example:
## In this example, the axes merge fails
library(tidyverse)
p6 <- mtcars %>% ggplot() + geom_point(aes(mpg, disp, color=cyl)) +
labs(y = "Axes to Merge",
x = "")
## setting the facet wrap to multiple rows
p7 <- ggplot(mtcars) + geom_point(aes(mpg, hp, color=cyl)) +
facet_wrap(~cyl, ncol = 2) +
labs(y = "Axes to Merge",
x = "")
p6 + p7 + plot_layout(guides='collect',
axes = "collect")
On the other hand, not having multiple rows in the p7 plot renders no issue.
## In this example, the axes merge is correct
library(tidyverse)
p6 <- mtcars %>% ggplot() + geom_point(aes(mpg, disp, color=cyl)) +
labs(y = "Axes to Merge",
x = "")
## not setting the facet_wrap to have multiple rows
p7 <- ggplot(mtcars) + geom_point(aes(mpg, hp, color=cyl)) +
facet_wrap(~cyl) +
labs(y = "Axes to Merge",
x = "")
p6 + p7 + plot_layout(guides='collect',
axes = "collect")
The text was updated successfully, but these errors were encountered:
Hello,
It looks like the plot_layout(axes = "collect") does not work when one of the plots has a facet_wrap that has multiple rows.
Take the following example:
On the other hand, not having multiple rows in the
p7
plot renders no issue.The text was updated successfully, but these errors were encountered: