From ebecea5559a069e999a9a58b9d35e2155d88a135 Mon Sep 17 00:00:00 2001 From: Yunuuuu Date: Thu, 12 Dec 2024 16:58:54 +0800 Subject: [PATCH] add padding cell in final gtable for NULL `plot.margin` (#6235) --- 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 b55c599198..f855dddd78 100644 --- a/R/plot-build.R +++ b/R/plot-build.R @@ -286,7 +286,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)) {