8000 FIX: review comments · matplotlib/matplotlib@31cb0c8 · GitHub
[go: up one dir, main page]

Skip to content

Commit 31cb0c8

Browse files
committed
FIX: review comments
1 parent 08cde82 commit 31cb0c8

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

lib/matplotlib/figure.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1121,12 +1121,15 @@ def legend(self, *args, **kwargs):
11211121
# handle outside legends:
11221122
if isinstance(loc, str):
11231123
if loc.split()[0] == 'outside':
1124-
loc = loc.split(' ', 1)[1:]
1124+
# strip outside:
1125+
loc = loc.split('outside ')[1]
1126+
# strip "center" at the beginning
11251127
outside = loc.replace('center ', '')
1128+
# strip first
11261129
outside = outside.split()[0]
11271130
locs = loc.split()
11281131
if len(locs) > 1 and locs[0] in ('right', 'left'):
1129-
# loc doesn't accept "left upper", etc, so swap
1132+
# locs doesn't accept "left upper", etc, so swap
11301133
if locs[0] != 'center':
11311134
locs = locs[::-1]
11321135
loc = locs[0] + ' ' + locs[1]

0 commit comments

Comments
 (0)
0