File tree 1 file changed +7
-6
lines changed
1 file changed +7
-6
lines changed Original file line number Diff line number Diff line change @@ -628,9 +628,9 @@ gg2list <- function(p) {
628
628
if (exists(" increase_margin_r" , where = as.environment(" package:plotly" ))) {
629
629
layout $ margin $ r <- 60
630
630
}
631
- layout $ legend <- list (bordercolor = " transparent" ,
632
- x = 1.05 , y = 1 / 2 ,
633
- xanchor = " center " , yanchor = " top " )
631
+ layout $ legend <- list (bordercolor = " transparent" ,
632
+ x = 1.01 , y = 0.5 ,
633
+ xanchor = " left " , yanchor = " center " )
634
634
635
635
# # Legend hiding when guides(fill="none").
636
636
legends.present <- unique(unlist(layer.legends ))
@@ -674,11 +674,12 @@ gg2list <- function(p) {
674
674
nann <- 1
675
675
}
676
676
annotations [[nann ]] <- list (text = legend.title ,
677
- x = layout $ legend $ x ,
678
- y = layout $ legend $ y * 1.04 ,
677
+ x = layout $ legend $ x * 1.0154 ,
678
+ y = layout $ legend $ y +
679
+ 0.5 * length(trace.list ) * 0.10 ,
679
680
showarrow = FALSE ,
680
681
xref = " paper" , yref = " paper" ,
681
- xanchor = " center" ,
682
+ xanchor = " left " , yanchor = " center" ,
682
683
textangle = 0 )
683
684
layout $ annotations <- annotations
684
685
}
You can’t perform that action at this time.
0 commit comments