Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 412f1b3

Browse files
committed
Simplify handling of unit and null bboxes
1 parent a129662 commit 412f1b3

1 file changed

Lines changed: 2 additions & 6 deletions

File tree

lib/matplotlib/transforms.py

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -794,25 +794,21 @@ def invalidate(self):
794794
self._check(self._points)
795795
TransformNode.invalidate(self)
796796

797-
_unit_values = np.array([[0.0, 0.0], [1.0, 1.0]], np.float_)
798-
799797
@staticmethod
800798
def unit():
801799
"""
802800
(staticmethod) Create a new unit :class:`Bbox` from (0, 0) to
803801
(1, 1).
804802
"""
805-
return Bbox(Bbox._unit_values.copy())
806-
807-
_null_values = np.array([[np.inf, np.inf], [-np.inf, -np.inf]], np.float_)
803+
return Bbox(np.array([[0.0, 0.0], [1.0, 1.0]], np.float))
808804

809805
@staticmethod
810806
def null():
811807
"""
812808
(staticmethod) Create a new null :class:`Bbox` from (inf, inf) to
813809
(-inf, -inf).
814810
"""
815-
return Bbox(Bbox._null_values.copy())
811+
return Bbox(np.array([[np.inf, np.inf], [-np.inf, -np.inf]], np.float))
816812

817813
@staticmethod
818814
def from_bounds(x0, y0, width, height):

0 commit comments

Comments
 (0)