From 6baa28ce53beb0a41a91d9a048faa4e8db88e3aa Mon Sep 17 00:00:00 2001 From: Elio Campitelli Date: Wed, 22 Nov 2023 15:39:48 -0300 Subject: [PATCH] Fixes partial matching on guides I caught this testing ggnewscale. This is using the latest dev. ``` r library(ggplot2) options(warnPartialMatchDollar = TRUE) ggplot(mpg, aes(displ, hwy)) + geom_point(aes(colour = factor(year)), size = 5) #> Warning in grobs$label: partial match of 'label' to 'labels' #> Warning in grobs$label: partial match of 'label' to 'labels' ``` I think this is the correct change. --- R/guide-axis.R | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/R/guide-axis.R b/R/guide-axis.R index 2914830746..de3ffb4a6a 100644 --- a/R/guide-axis.R +++ b/R/guide-axis.R @@ -377,7 +377,7 @@ GuideAxis <- ggproto( spacer <- max(unit(0, "pt"), unit(-1 * diff(range), "cm")) # Text - labels <- unit(measure(grobs$label), "cm") + labels <- unit(measure(grobs$labels), "cm") title <- unit(measure(grobs$title), "cm") sizes <- unit.c(length, spacer, labels, title)