@@ -42,11 +42,11 @@ def default_units(x, axis):
42
42
43
43
"""
44
44
45
+ from decimal import Decimal
45
46
from numbers import Number
46
47
47
48
import numpy as np
48
49
from numpy import ma
49
- from decimal import Decimal
50
50
51
51
from matplotlib import cbook
52
52
@@ -55,6 +55,20 @@ class ConversionError(TypeError):
55
55
pass
56
56
57
57
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
+
58
72
class AxisInfo :
59
73
"""
60
74
Information to support default axis labeling, tick labeling, and limits.
@@ -134,21 +148,6 @@ def is_numlike(x):
134
148
else :
135
149
return isinstance (x , Number )
136
150
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
-
152
151
153
152
class DecimalConverter (ConversionInterface ):
154
153
"""
0 commit comments