@@ -105,8 +105,9 @@ markLegends <-
105
105
# # group, even when they have the exact same visual
106
106
# # characteristics and could be drawn using just 1 trace!
107
107
polygon = c(" colour" , " fill" , " linetype" , " size" ),
108
- bar = c(" colour" , " fill" ),
109
- density = c(" colour" , " fill" , " linetype" ),
108
+ bar = c(" colour" , " fill" ),
109
+ density = c(" colour" , " fill" , " linetype" ),
110
+ boxplot = c(" colour" , " fill" , " size" ),
110
111
errorbar = c(" colour" , " linetype" ),
111
112
errorbarh = c(" colour" , " linetype" ),
112
113
area = c(" colour" , " fill" ),
@@ -115,7 +116,8 @@ markLegends <-
115
116
116
117
markUnique <- as.character(unique(unlist(markLegends )))
117
118
118
- markSplit <- c(markLegends ,list (boxplot = c(" x" )))
119
+ markSplit <- markLegends
120
+ markSplit $ boxplot <- c(markSplit $ boxplot , " x" )
119
121
120
122
guide_names <- function (p , aes = c(" shape" , " fill" , " alpha" , " area" ,
121
123
" color" , " colour" , " size" , " linetype" )) {
@@ -306,9 +308,6 @@ gg2list <- function(p) {
306
308
traces <- layer2traces(L , df , misc )
307
309
308
310
possible.legends <- markLegends [[L $ geom $ objname ]]
309
- if (L $ geom $ objname == " boxplot" ){
310
- possible.legends <- markSplit [[L $ geom $ objname ]]
311
- }
312
311
actual.legends <- possible.legends [possible.legends %in% names(L $ mapping )]
313
312
layer.legends [[paste(i )]] <- actual.legends
314
313
0 commit comments