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

Skip to content

Commit 90f6eb8

Browse files
committed
Use cbook._str{,_lower}_equal in more places.
1 parent 0f61459 commit 90f6eb8

3 files changed

Lines changed: 5 additions & 5 deletions

File tree

lib/matplotlib/colors.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -248,7 +248,7 @@ def to_rgba_array(c, alpha=None):
248248
# Note that this occurs *after* handling inputs that are already arrays, as
249249
# `to_rgba(c, alpha)` (below) is expensive for such inputs, due to the need
250250
# to format the array in the ValueError message(!).
251-
if isinstance(c, str) and c.lower() == "none":
251+
if cbook._str_lower_equal(c, "none"):
252252
return np.zeros((0, 4), float)
253253
try:
254254
return np.array([to_rgba(c, alpha)], float)

lib/matplotlib/lines.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -861,7 +861,7 @@ def get_marker(self):
861861

862862
def get_markeredgecolor(self):
863863
mec = self._markeredgecolor
864-
if isinstance(mec, six.string_types) and mec == 'auto':
864+
if cbook._str_equal(mec, 'auto'):
865865
if rcParams['_internal.classic_mode']:
866866
if self._marker.get_marker() in ('.', ','):
867867
return self._color
@@ -1125,8 +1125,8 @@ def set_markeredgecolor(self, ec):
11251125
"""
11261126
if ec is None:
11271127
ec = 'auto'
1128-
if self._markeredgecolor is None or \
1129-
np.any(self._markeredgecolor != ec):
1128+
if (self._markeredgecolor is None
1129+
or np.any(self._markeredgecolor != ec)):
11301130
self.stale = True
11311131
self._markeredgecolor = ec
11321132

lib/matplotlib/rcsetup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -882,7 +882,7 @@ def validate_cycler(s):
882882

883883

884884
def validate_hist_bins(s):
885-
if isinstance(s, six.string_types) and s == 'auto':
885+
if cbook._str_equal(s, "auto"):
886886
return s
887887
try:
888888
return int(s)

0 commit comments

Comments
 (0)