File tree 1 file changed +9
-1
lines changed
1 file changed +9
-1
lines changed Original file line number Diff line number Diff line change @@ -1512,7 +1512,15 @@ scales_add_missing <- function(plot, aesthetics) {
1512
1512
# towards ggproto methods attached to `plot$guides`
1513
1513
# -------------------------------------------------------------------------
1514
1514
get_gdefs_ggproto <- function (scales , theme , plot , layers ) {
1515
- guides <- plot $ guides $ setup(scales )
1515
+
1516
+ # Proposed change to accomodate
1517
+ # https://github.com/tidyverse/ggplot2/pull/5428
1518
+ # Ensure a 1:1 mapping between aesthetics and scales
1519
+ aesthetics <- lapply(scales , `[[` , " aesthetics" )
1520
+ scales <- rep.int(scales , lengths(aesthetics ))
1521
+ aesthetics <- unlist(aesthetics , recursive = FALSE , use.names = FALSE )
1522
+
1523
+ guides <- plot $ guides $ setup(scales , aesthetics = aesthetics )
1516
1524
guides $ train(scales , theme $ legend.direction , plot $ labels )
1517
1525
if (length(guides $ guides ) > 0 ) {
1518
1526
guides $ merge()
You can’t perform that action at this time.
0 commit comments