From d280d5bb3aad98a472c024d22d80f86beee43f5f Mon Sep 17 00:00:00 2001 From: hadley Date: Sun, 20 May 2018 20:06:55 -0500 Subject: [PATCH] Add default value for legend.position Fixes #2640 --- 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 78c65a0fe4..6fb2689090 100644 --- a/R/plot-build.r +++ b/R/plot-build.r @@ -159,7 +159,7 @@ ggplot_gtable.ggplot_built <- function(data) { plot_table <- layout$render(geom_grobs, data, theme, plot$labels) # Legends - position <- theme$legend.position + position <- theme$legend.position %||% "right" if (length(position) == 2) { position <- "manual" }