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 c8a26aa commit 66647b0Copy full SHA for 66647b0
lib/matplotlib/units.py
@@ -145,7 +145,13 @@ def get_converter(self, x):
145
return converter
146
except AttributeError:
147
# not a masked_array
148
- converter = self.get_converter(xravel[0])
+ # Make sure we don't recurse forever -- it's possible for
149
+ # ndarray subclasses to continue to return subclasses and
150
+ # not ever return a non-subclass for a single element.
151
+ next_item = xravel[0]
152
+ if (not isinstance(next_item, np.ndarray) or
153
+ next_item.shape != x.shape):
154
+ converter = self.get_converter(next_item)
155
156
157
if converter is None and iterable(x):
0 commit comments