From 8f96286accef9a171aa762d64b1b1e5d32dd1b42 Mon Sep 17 00:00:00 2001 From: Teun van den Brand Date: Mon, 25 Nov 2024 09:23:06 +0100 Subject: [PATCH 1/2] apply order --- R/guides-.R | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/R/guides-.R b/R/guides-.R index d250c78025..6cbb289ec9 100644 --- a/R/guides-.R +++ b/R/guides-.R @@ -308,8 +308,9 @@ Guides <- ggproto( return(no_guides) } - guides$guides <- c(guides$guides, custom$guides) - guides$params <- c(guides$params, custom$params) + ord <- order(c(names(guides$guides), names(custom$guides))) + guides$guides <- c(guides$guides, custom$guides)[ord] + guides$params <- c(guides$params, custom$params)[ord] guides }, From 6c3307eb35af7ee8f67885fc7f16aef09918a665 Mon Sep 17 00:00:00 2001 From: Teun van den Brand Date: Mon, 25 Nov 2024 09:28:12 +0100 Subject: [PATCH 2/2] add news bullet --- NEWS.md | 1 + 1 file changed, 1 insertion(+) diff --git a/NEWS.md b/NEWS.md index 0c493a8f58..b7713c13e9 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,5 +1,6 @@ # ggplot2 (development version) +* Fixed a bug where the `guide_custom(order)` wasn't working (@teunbrand, #6195) * Custom and raster annotation now respond to scale transformations, and can use AsIs variables for relative placement (@teunbrand based on @yutannihilation's prior work, #3120)