We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent f8b425d commit 517b575Copy full SHA for 517b575
lib/matplotlib/ticker.py
@@ -2130,7 +2130,16 @@ def subs(self, subs):
2130
"found '%s'." % subs)
2131
self._subs = subs
2132
else:
2133
- self._subs = np.asarray(subs, dtype=float)
+ try:
2134
+ self._subs = np.asarray(subs, dtype=float)
2135
+ except ValueError as e:
2136
+ raise ValueError("If subs is not None and not a string, "
2137
+ "it must be a sequence of float.") from e
2138
+ if self._subs.ndim != 1:
2139
+ raise ValueError("If subs is not None and not a string, it "
2140
+ "must be a sequence of float. Hence subs "
2141
+ "should have 1 dimension but it has {} "
2142
+ "dimensions.".format(self._subs.ndim))
2143
2144
def __call__(self):
2145
'Return the locations of the ticks'
0 commit comments