Skip to content

Commit 5ffafd0

Browse files
authored
Merge pull request #27517 from oscargus/bestlegendsubopt
Best-legend-location microoptimization
2 parents 6a4ae80 + b986f60 commit 5ffafd0

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

lib/matplotlib/legend.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -981,8 +981,7 @@ def _auto_legend_data(self):
981981
elif isinstance(artist, Collection):
982982
transform, transOffset, hoffsets, _ = artist._prepare_points()
983983
if len(hoffsets):
984-
for offset in transOffset.transform(hoffsets):
985-
offsets.append(offset)
984+
offsets.extend(transOffset.transform(hoffsets))
986985

987986
return bboxes, lines, offsets
988987

0 commit comments

Comments
 (0)