@@ -42,11 +42,11 @@ def default_units(x, axis):
4242
4343"""
4444
45+ from decimal import Decimal
4546from numbers import Number
4647
4748import numpy as np
4849from numpy import ma
49- from decimal import Decimal
5050
5151from matplotlib import cbook
5252
@@ -55,6 +55,20 @@ class ConversionError(TypeError):
5555 pass
5656
5757
58+ def _is_natively_supported (x ):
59+ """
60+ Return whether *x* is of a type that Matplotlib natively supports or an
61+ array of objects of such types.
62+ """
63+ # Matplotlib natively supports all number types except Decimal.
64+ if np .iterable (x ):
65+ # Assume lists are homogeneous as other functions in unit system.
66+ for thisx in x :
67+ return isinstance (thisx , Number ) and not isinstance (thisx , Decimal )
68+ else :
69+ return isinstance (x , Number ) and not isinstance (x , Decimal )
70+
71+
5872class AxisInfo :
5973 """
6074 Information to support default axis labeling, tick labeling, and limits.
@@ -134,21 +148,6 @@ def is_numlike(x):
134148 else :
135149 return isinstance (x , Number )
136150
137- @staticmethod
138- def is_natively_supported (x ):
139- """
140- Return whether *x* is of a type that Matplotlib natively supports or
141- *x* is array of objects of such types.
142- """
143- # Matplotlib natively supports all number types except Decimal
144- if np .iterable (x ):
145- # Assume lists are homogeneous as other functions in unit system
146- for thisx in x :
147- return (isinstance (thisx , Number ) and
148- not isinstance (thisx , Decimal ))
149- else :
150- return isinstance (x , Number ) and not isinstance (x , Decimal )
151-
152151
153152class DecimalConverter (ConversionInterface ):
154153 """
0 commit comments