From ada51df94de5f434c7564790b6c6e94cb432b5cd Mon Sep 17 00:00:00 2001 From: Jacob Bumgarner Date: Mon, 3 Nov 2025 22:45:09 -0500 Subject: [PATCH 1/2] pass plot into `alt` lambda to match S7 method --- R/labels.R | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/R/labels.R b/R/labels.R index b3765427cf..48969eeb23 100644 --- a/R/labels.R +++ b/R/labels.R @@ -105,7 +105,7 @@ setup_plot_labels <- function(plot, layers, data) { if (!is.function(label)) { return(label) } - label(labels[[nm]] %||% "") + label(plot %||% "") }) dict <- plot_labels$dictionary From ffd7d252696137619192d0fd0d51128e0b2ab5a4 Mon Sep 17 00:00:00 2001 From: Jacob Bumgarner Date: Mon, 3 Nov 2025 23:01:03 -0500 Subject: [PATCH 2/2] differentiate label lambda evaluation to function properly for aesthetic and titles --- R/labels.R | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/R/labels.R b/R/labels.R index 48969eeb23..75413e7485 100644 --- a/R/labels.R +++ b/R/labels.R @@ -105,7 +105,12 @@ setup_plot_labels <- function(plot, layers, data) { if (!is.function(label)) { return(label) } - label(plot %||% "") + + if (nm %in% c("alt", "alt_insight")) { + label(plot %||% "") + } else { + label(labels[[nm]] %||% "") + } }) dict <- plot_labels$dictionary