Skip to content

Commit 24fa78d

Browse files
committed
FIX: legend issue with bbox_inches="tight"
1 parent 626d54f commit 24fa78d

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

lib/matplotlib/figure.py

+4-1
Original file line numberDiff line numberDiff line change
@@ -1753,7 +1753,10 @@ def legend(self, *args, **kwargs):
17531753
# kwargs['loc'] = extra_args[0]
17541754
# extra_args = extra_args[1:]
17551755
pass
1756-
l = mlegend.Legend(self, handles, labels, *extra_args, **kwargs)
1756+
transform = kwargs.pop('bbox_transform', self.transFigure)
1757+
# explicitly set the bbox transform if the user hasn't.
1758+
l = mlegend.Legend(self, handles, labels, *extra_args,
1759+
bbox_transform=transform, **kwargs)
17571760
self.legends.append(l)
17581761
l._remove_method = self.legends.remove
17591762
self.stale = True

0 commit comments

Comments
 (0)