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

Skip to content

Commit 9c61a9d

Browse files
committed
MNT: remove unreachable code
The validation on the rcParams means that `rcParams['axes.prop_cycle']` can never be None.
1 parent 14664e2 commit 9c61a9d

File tree

2 files changed

+0
-7
lines changed

2 files changed

+0
-7
lines changed

lib/matplotlib/axes/_base.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -164,9 +164,6 @@ def __setstate__(self, state):
164164
def set_prop_cycle(self, *args, **kwargs):
165165
if not (args or kwargs) or (len(args) == 1 and args[0] is None):
166166
prop_cycler = rcParams['axes.prop_cycle']
167-
if prop_cycler is None and 'axes.color_cycle' in rcParams:
168-
clist = rcParams['axes.color_cycle']
169-
prop_cycler = cycler('color', clist)
170167
else:
171168
prop_cycler = cycler(*args, **kwargs)
172169

lib/matplotlib/colors.py

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -126,11 +126,7 @@ def to_rgba(c, alpha=None):
126126
# Special-case nth color syntax because it should not be cached.
127127
if _is_nth_color(c):
128128
from matplotlib import rcParams
129-
from matplotlib.rcsetup import cycler
130129
prop_cycler = rcParams['axes.prop_cycle']
131-
if prop_cycler is None and 'axes.color_cycle' in rcParams:
132-
clist = rcParams['axes.color_cycle']
133-
prop_cycler = cycler('color', clist)
134130
colors = prop_cycler._transpose().get('color', 'k')
135131
c = colors[int(c[1]) % len(colors)]
136132
try:

0 commit comments

Comments
 (0)