diff --git a/NEWS.md b/NEWS.md index 269e6f7..7bf4b49 100644 --- a/NEWS.md +++ b/NEWS.md @@ -4,6 +4,8 @@ Collecting axes will remove duplicated axes in the x- or y-direction. Collecting axis titles will also remove duplicated titles in the x- or y-direction, but also merge duplicated titles in the other direction (#150). +* Fix a bug that prevented faceted plots with axes on the right from being + used (#340) # patchwork 1.1.3 diff --git a/R/plot_patchwork.R b/R/plot_patchwork.R index 3440541..d93421e 100644 --- a/R/plot_patchwork.R +++ b/R/plot_patchwork.R @@ -689,7 +689,7 @@ add_strips <- function(gt) { } if (!any(grepl('strip-l', gt$layout$name))) { gt <- gtable_add_cols(gt, unit(0, 'mm'), panel_loc$l - 1 - strip_pos) - } else if (strip_pos == 2) { + } else if (strip_pos == 2 && !any(gt$layout$l == panel_loc$l - 2)) { gt$widths[panel_loc$l - 1] <- sum(gt$widths[panel_loc$l - c(1, 2)]) gt <- gt[, -(panel_loc$l - 2)] }