Skip to content

Guide custom order #6199

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Jan 27, 2025
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -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)
Expand Down
5 changes: 3 additions & 2 deletions R/guides-.R
Original file line number Diff line number Diff line change
Expand Up @@ -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
},
Expand Down
Loading