diff --git a/lib/matplotlib/projections/polar.py b/lib/matplotlib/projections/polar.py index c33fa0560f0b..dac76c04a7bb 100644 --- a/lib/matplotlib/projections/polar.py +++ b/lib/matplotlib/projections/polar.py @@ -719,9 +719,7 @@ class _WedgeBbox(mtransforms.Bbox): Bbox determining the origin for the wedge, if different from *viewLim* """ def __init__(self, center, viewLim, originLim, **kwargs): - mtransforms.Bbox.__init__(self, - np.array([[0.0, 0.0], [1.0, 1.0]], np.float), - **kwargs) + mtransforms.Bbox.__init__(self, [[0, 0], [1, 1]], **kwargs) self._center = center self._viewLim = viewLim self._originLim = originLim diff --git a/lib/matplotlib/transforms.py b/lib/matplotlib/transforms.py index e4a37373e9a1..1bbb609369b4 100644 --- a/lib/matplotlib/transforms.py +++ b/lib/matplotlib/transforms.py @@ -763,12 +763,12 @@ def invalidate(self): @staticmethod def unit(): """Create a new unit `Bbox` from (0, 0) to (1, 1).""" - return Bbox(np.array([[0.0, 0.0], [1.0, 1.0]], float)) + return Bbox([[0, 0], [1, 1]]) @staticmethod def null(): """Create a new null `Bbox` from (inf, inf) to (-inf, -inf).""" - return Bbox(np.array([[np.inf, np.inf], [-np.inf, -np.inf]], float)) + return Bbox([[np.inf, np.inf], [-np.inf, -np.inf]]) @staticmethod def from_bounds(x0, y0, width, height): @@ -786,8 +786,7 @@ def from_extents(*args): The *y*-axis increases upwards. """ - points = np.array(args, dtype=float).reshape(2, 2) - return Bbox(points) + return Bbox(np.reshape(args, (2, 2))) def __format__(self, fmt): return ( diff --git a/lib/matplotlib/units.py b/lib/matplotlib/units.py index 89ccaeb7aab2..034299d38ab5 100644 --- a/lib/matplotlib/units.py +++ b/lib/matplotlib/units.py @@ -155,9 +155,8 @@ def is_numlike(x): class DecimalConverter(ConversionInterface): - """ - Converter for decimal.Decimal data to float. - """ + """Converter for decimal.Decimal data to float.""" + @staticmethod def convert(value, unit, axis): """ @@ -172,13 +171,13 @@ def convert(value, unit, axis): """ # If value is a Decimal if isinstance(value, Decimal): - return np.float(value) + return float(value) else: # assume x is a list of Decimal converter = np.asarray if isinstance(value, ma.MaskedArray): converter = ma.asarray - return converter(value, dtype=np.float) + return converter(value, dtype=float) @staticmethod def axisinfo(unit, axis):