Thanks to visit codestin.com Credit goes to github.com
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 145ade6 commit fd04111Copy full SHA for fd04111
lib/matplotlib/ticker.py
@@ -2382,7 +2382,16 @@ def subs(self, subs):
2382
cbook._check_in_list(('all', 'auto'), subs=subs)
2383
self._subs = subs
2384
else:
2385
- self._subs = np.asarray(subs, dtype=float)
+ try:
2386
+ self._subs = np.asarray(subs, dtype=float)
2387
+ except ValueError as e:
2388
+ raise ValueError("If subs is not None and not a string, "
2389
+ "it must be a sequence of float.") from e
2390
+ if self._subs.ndim != 1:
2391
+ raise ValueError("If subs is not None and not a string, it "
2392
+ "must be a sequence of float. Hence subs "
2393
+ "should have 1 dimension but it has {} "
2394
+ "dimensions.".format(self._subs.ndim))
2395
2396
def __call__(self):
2397
'Return the locations of the ticks'
0 commit comments