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

Skip to content

Commit df2e51a

Browse files
committed
Make comparison work with arrays
1 parent 58a221d commit df2e51a

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

lib/matplotlib/legend.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1351,20 +1351,20 @@ def _in_handles(h, l):
13511351
if type(f_h) != type(h):
13521352
continue
13531353
try:
1354-
if (colors.to_rgba(f_h.get_color()) !=
1355-
colors.to_rgba(h.get_color())):
1354+
if (colors.to_rgba_array(f_h.get_color()) !=
1355+
colors.to_rgba_array(h.get_color())).any():
13561356
continue
13571357
except AttributeError:
13581358
pass
13591359
try:
1360-
if (colors.to_rgba(f_h.get_facecolor()) !=
1361-
colors.to_rgba(h.get_facecolor())):
1360+
if (colors.to_rgba_array(f_h.get_facecolor()) !=
1361+
colors.to_rgba_array(h.get_facecolor())).any():
13621362
continue
13631363
except AttributeError:
13641364
pass
13651365
try:
1366-
if (colors.to_rgba(f_h.get_edgecolor()) !=
1367-
colors.to_rgba(h.get_edgecolor())):
1366+
if (colors.to_rgba_array(f_h.get_edgecolor()) !=
1367+
colors.to_rgba_array(h.get_edgecolor())).any():
13681368
continue
13691369
except AttributeError:
13701370
pass

0 commit comments

Comments
 (0)