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

Skip to content

Commit cbad5d7

Browse files
committed
FIX: fix all of the weird input validation
1 parent 5873ed1 commit cbad5d7

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

lib/matplotlib/axes/_axes.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
from matplotlib import unpack_labeled_data
1515

1616
import matplotlib.cbook as cbook
17-
from matplotlib.cbook import (mplDeprecation, STEP_LOOKUP_MAP, is_sequence_of_strings,
17+
from matplotlib.cbook import (mplDeprecation, STEP_LOOKUP_MAP,
1818
iterable, is_string_like)
1919
import matplotlib.collections as mcoll
2020
import matplotlib.colors as mcolors
@@ -2184,11 +2184,11 @@ def make_iterable(x):
21842184

21852185
if tick_labels is not None:
21862186
tick_labels = make_iterable(tick_labels)
2187-
if not is_sequence_of_strings(tick_labels):
2188-
raise ValueError("tick_label must be a sequence of strings")
2187+
if isinstance(tick_labels, six.string_types):
2188+
tick_labels = [tick_labels]
21892189
if len(tick_labels) == 1:
2190-
tick_labels *= tick_label_position
2191-
if len(tick_labels) != tick_label_position:
2190+
tick_labels *= nbars
2191+
if len(tick_labels) != nbars:
21922192
raise ValueError("incompatible sizes: argument 'tick_label' "
21932193
"must be length %d or string" % nbars)
21942194

0 commit comments

Comments
 (0)