File tree Expand file tree Collapse file tree 1 file changed +29
-5
lines changed Expand file tree Collapse file tree 1 file changed +29
-5
lines changed Original file line number Diff line number Diff line change 1111if strcmp(a .Visible , ' on' )
1212
1313 % POSITION
14- legend.x = a .Position(1 )+a .Position(3 )/2 ;
15- legend.y = a .Position(2 )+a .Position(4 )/2 ;
16- legend.xanchor = ' middle' ;
17- legend.yanchor = ' middle' ;
18-
14+ x_ref = a .Position(1 )+a .Position(3 )/2 ;
15+ y_ref = a .Position(2 )+a .Position(4 )/2 ;
16+ if x_ref > 0.333
17+ if x_ref > 0.666
18+ legend.x = a .Position(1 )+a .Position(3 );
19+ legend.xanchor = ' right' ;
20+ else
21+ legend.x = a .Position(1 )+a .Position(3 )/2 ;
22+ legend.xanchor = ' middle' ;
23+ end
24+ else
25+ legend.x = a .Position(1 );
26+ legend.xanchor = ' left' ;
27+ end
28+
29+ if y_ref > 0.333
30+ if y_ref > 0.666
31+ legend.y = a .Position(2 )+a .Position(4 );
32+ legend.yanchor = ' top' ;
33+ else
34+ legend.y = a .Position(2 )+a .Position(4 )/2 ;
35+ legend.yanchor = ' middle' ;
36+ end
37+ else
38+ legend.y = a .Position(2 );
39+ legend.yanchor = ' bottom' ;
40+ end
41+
42+
1943end
2044
2145end
You can’t perform that action at this time.
0 commit comments