8000 Moving the PolyCollection path to line conversion into the elif chain… · matplotlib/matplotlib@90d8a75 · GitHub
[go: up one dir, main page]

Skip to content

Commit 90d8a75

Browse files
committed
Moving the PolyCollection path to line conversion into the elif chain instead of inside the Collection if case
1 parent a19a24c commit 90d8a75

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

lib/matplotlib/legend.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -978,15 +978,15 @@ def _auto_legend_data(self):
978978
elif isinstance(artist, Patch):
979979
lines.append(
980980
artist.get_transform().transform_path(artist.get_path()))
981+
elif isinstance(artist, PolyCollection):
982+
paths = artist.get_paths()
983+
for path in paths:
984+
lines.append(artist.get_transform().transform_path(path))
981985
elif isinstance(artist, Collection):
982986
transform, transOffset, hoffsets, _ = artist._prepare_points()
983987
if len(hoffsets):
984988
for offset in transOffset.transform(hoffsets):
985989
offsets.append(offset)
986-
if isinstance(artist, PolyCollection):
987-
paths = artist.get_paths()
988-
for path in paths:
989-
lines.append(artist.get_transform().transform_path(path))
990990
elif isinstance(artist, Text):
991991
bboxes.append(artist.get_window_extent())
992992

0 commit comments

Comments
 (0)
0