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

Skip to content

Commit 415cd6a

Browse files
authored
Fix using .get_color() and friends in labels handling
This code was introduced in v2.1.1 and, apparently, wasn't tested, because .get_color() returns array. Here is an issue example: sympy/sympy#13730 (comment)
1 parent 7a6bab7 commit 415cd6a

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

lib/matplotlib/legend.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1350,17 +1350,17 @@ def _in_handles(h, l):
13501350
if type(f_h) != type(h):
13511351
continue
13521352
try:
1353-
if f_h.get_color() != h.get_color():
1353+
if (f_h.get_color() != h.get_color()).any():
13541354
continue
13551355
except AttributeError:
13561356
pass
13571357
try:
1358-
if f_h.get_facecolor() != h.get_facecolor():
1358+
if (f_h.get_facecolor() != h.get_facecolor()).any():
13591359
continue
13601360
except AttributeError:
13611361
pass
13621362
try:
1363-
if f_h.get_edgecolor() != h.get_edgecolor():
1363+
if (f_h.get_edgecolor() != h.get_edgecolor()).any():
13641364
continue
13651365
except AttributeError:
13661366
pass

0 commit comments

Comments
 (0)