diff --git a/lib/matplotlib/legend.py b/lib/matplotlib/legend.py index ba9ee10ef10c..67925b9a99bc 100644 --- a/lib/matplotlib/legend.py +++ b/lib/matplotlib/legend.py @@ -981,8 +981,7 @@ def _auto_legend_data(self): elif isinstance(artist, Collection): transform, transOffset, hoffsets, _ = artist._prepare_points() if len(hoffsets): - for offset in transOffset.transform(hoffsets): - offsets.append(offset) + offsets.extend(transOffset.transform(hoffsets)) return bboxes, lines, offsets