8000 MNT: remove implicit color from cycler axes._base · matplotlib/matplotlib@701bfb0 · GitHub
[go: up one dir, main page]

Skip to content

Commit 701bfb0

Browse files
committed
MNT: remove implicit color from cycler axes._base
1 parent ef4aed5 commit 701bfb0

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

lib/matplotlib/axes/_base.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -167,10 +167,6 @@ def set_prop_cycle(self, *args, **kwargs):
167167
else:
168168
prop_cycler = cycler(*args, **kwargs)
169169

170-
# Make sure the cycler always has at least one color
171-
if 'color' not in prop_cycler.keys:
172-
prop_cycler = prop_cycler * cycler('color', ['k'])
173-
174170
self.prop_cycler = itertools.cycle(prop_cycler)
175171
# This should make a copy
176172
self._prop_keys = prop_cycler.keys
@@ -200,6 +196,8 @@ def get_next_color(self):
200196
"""
201197
Return the next color in the cycle.
202198
"""
199+
if 'color' not in self._prop_keys:
200+
return 'k'
203201
return six.next(self.prop_cycler)['color']
204202

205203
def set_lineprops(self, line, **kwargs):

0 commit comments

Comments
 (0)
0