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 6a61f93 commit 5ac46dbCopy full SHA for 5ac46db
lib/matplotlib/ticker.py
@@ -2127,7 +2127,16 @@ def subs(self, subs):
2127
"found '%s'." % subs)
2128
self._subs = subs
2129
else:
2130
- self._subs = np.asarray(subs, dtype=float)
+ try:
2131
+ self._subs = np.asarray(subs, dtype=float)
2132
+ except ValueError as e:
2133
+ raise ValueError("If subs is not None and not a string, "
2134
+ "it must be a sequence of float.") from e
2135
+ if subs.ndim != 1:
2136
+ raise ValueError("If subs is not None and not a string, it "
2137
+ "must be a sequence of float. Hence subs "
2138
+ "should have 1 dimension but it has {} "
2139
+ "dimensions.".format(subs.ndim))
2140
2141
def __call__(self):
2142
'Return the locations of the ticks'
0 commit comments