Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit f62d909

Browse files
committed
Best-legend-location microoptimization
1 parent ca946ac commit f62d909

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(offset for offset in transOffset.transform(hoffsets))
986985

987986
return bboxes, lines, offsets
988987

0 commit comments

Comments
 (0)