File tree Expand file tree Collapse file tree 1 file changed +6
-4
lines changed Expand file tree Collapse file tree 1 file changed +6
-4
lines changed Original file line number Diff line number Diff line change @@ -495,7 +495,9 @@ gg2list <- function(p){
495
495
if (exists(" increase_margin_r" )) {
496
496
layout $ margin $ r <- 60
497
497
}
498
- layout $ legend <- list (bordercolor = " transparent" , x = 1 , y = 1 / 2 )
498
+ layout $ legend <- list (bordercolor = " transparent" ,
499
+ x = 1.05 , y = 1 / 2 ,
500
+ xanchor = " center" , yanchor = " top" )
499
501
500
502
# Workaround for removing unnecessary legends.
501
503
# [markUnique != "x"] is for boxplot's particular case.
@@ -520,11 +522,11 @@ gg2list <- function(p){
520
522
nann <- 1
521
523
}
522
524
annotations [[nann ]] <- list (text = legend.title ,
523
- x = layout $ legend $ x * 1.013 ,
524
- y = layout $ legend $ y * ( 1 + (length( traces ) * 0.04 )) + 0 .04 ,
525
+ x = layout $ legend $ x ,
526
+ y = layout $ legend $ y * 1 .04 ,
525
527
showarrow = FALSE ,
526
528
xref = " paper" , yref = " paper" ,
527
- xanchor = " left " , yanchor = " top " ,
529
+ xanchor = " center " ,
528
530
textangle = 0 )
529
531
layout $ annotations <- annotations
530
532
}
You can’t perform that action at this time.
0 commit comments