From 5769010a76d22be7aafe02482a9c88550412cc33 Mon Sep 17 00:00:00 2001 From: thomasp85 Date: Tue, 4 Oct 2016 00:18:55 +0200 Subject: [PATCH] fix stacking --- R/facet-grid-.r | 2 +- R/facet-wrap.r | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/R/facet-grid-.r b/R/facet-grid-.r index 449aeee532..51b1301664 100644 --- a/R/facet-grid-.r +++ b/R/facet-grid-.r @@ -311,7 +311,7 @@ FacetGrid <- ggproto("FacetGrid", Facet, } panel_table <- gtable_matrix("layout", panel_table, - panel_widths, panel_heights, respect = respect, clip = "on") + panel_widths, panel_heights, respect = respect, clip = "on", z = matrix(1, ncol = ncol, nrow = nrow)) panel_table$layout$name <- paste0('panel-', rep(seq_len(ncol), nrow), '-', rep(seq_len(nrow), each = ncol)) panel_table <- gtable_add_col_space(panel_table, diff --git a/R/facet-wrap.r b/R/facet-wrap.r index 621a5285f3..7aef98aec6 100644 --- a/R/facet-wrap.r +++ b/R/facet-wrap.r @@ -231,7 +231,7 @@ FacetWrap <- ggproto("FacetWrap", Facet, empties <- apply(panel_table, c(1,2), function(x) is.zero(x[[1]])) panel_table <- gtable_matrix("layout", panel_table, widths = unit(rep(1, ncol), "null"), - heights = unit(rep(aspect_ratio, nrow), "null"), respect = respect, clip = "on") + heights = unit(rep(aspect_ratio, nrow), "null"), respect = respect, clip = "on", z = matrix(1, ncol = ncol, nrow = nrow)) panel_table$layout$name <- paste0('panel-', rep(seq_len(ncol), nrow), '-', rep(seq_len(nrow), each = ncol)) panel_table <- gtable_add_col_space(panel_table,