Skip to content

Commit 55ad10d

Browse files
committed
make sure marker colors also accept np.array
1 parent 7139b51 commit 55ad10d

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

lib/matplotlib/lines.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1160,7 +1160,8 @@ def set_markeredgecolor(self, ec):
11601160
"""
11611161
if ec is None:
11621162
ec = 'auto'
1163-
if self._markeredgecolor is None or self._markeredgecolor != ec:
1163+
if self._markeredgecolor is None or \
1164+
np.any(self._markeredgecolor != ec):
11641165
self.stale = True
11651166
self._markeredgecolor = ec
11661167

@@ -1184,7 +1185,7 @@ def set_markerfacecolor(self, fc):
11841185
"""
11851186
if fc is None:
11861187
fc = 'auto'
1187-
if self._markerfacecolor != fc:
1188+
if np.any(self._markerfacecolor != fc):
11881189
self.stale = True
11891190
self._markerfacecolor = fc
11901191

@@ -1196,7 +1197,7 @@ def set_markerfacecoloralt(self, fc):
11961197
"""
11971198
if fc is None:
11981199
fc = 'auto'
1199-
if self._markerfacecoloralt != fc:
1200+
if np.any(self._markerfacecoloralt != fc):
12001201
self.stale = True
12011202
self._markerfacecoloralt = fc
12021203

lib/matplotlib/tests/test_lines.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,8 @@ def test_set_line_coll_dash_image():
143143
@image_comparison(baseline_images=['marker_fill_styles'], remove_text=True,
144144
extensions=['png'])
145145
def test_marker_fill_styles():
146-
colors = itertools.cycle(['b', 'g', 'r', 'c', 'm', 'y', 'k'])
146+
colors = itertools.cycle([[0, 0, 1], 'g', '#ff0000', 'c', 'm', 'y',
147+
np.array([0, 0, 0])])
147148
altcolor = 'lightgreen'
148149

149150
y = np.array([1, 1])

0 commit comments

Comments
 (0)