From 9552a67273ef919e3ae45b61b6d7bcddfe88d9e0 Mon Sep 17 00:00:00 2001 From: Yunuuuu Date: Thu, 12 Dec 2024 16:24:07 +0800 Subject: [PATCH] add padding cell in final gtable for NULL `plot.margin` --- R/plot-build.R | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/R/plot-build.R b/R/plot-build.R index 873f79a32c..d0a5a6660b 100644 --- a/R/plot-build.R +++ b/R/plot-build.R @@ -285,7 +285,7 @@ ggplot_gtable.ggplot_built <- function(data) { plot_table <- table_add_tag(plot_table, plot$labels$tag, theme) # Margins - plot_margin <- calc_element("plot.margin", theme) + plot_margin <- calc_element("plot.margin", theme) %||% margin() plot_table <- gtable_add_padding(plot_table, plot_margin) if (is.theme_element(theme$plot.background)) {