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

Skip to content

Commit c0e2b02

Browse files
committed
Slightly tighten the Bbox API.
Bbox.is_unit was added in 23588bf but never, ever used.
1 parent ef3a17a commit c0e2b02

File tree

3 files changed

+12
-4
lines changed

3 files changed

+12
-4
lines changed
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
Deprecations
2+
````````````
3+
4+
``BboxBase.is_unit`` is deprecated (check the Bbox extents if needed).
5+
6+
``axes3d.unit_bbox`` is deprecated (use ``Bbox.unit`` instead).

lib/matplotlib/transforms.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -278,6 +278,7 @@ def frozen(self):
278278
def __array__(self, *args, **kwargs):
279279
return self.get_points()
280280

281+
@cbook.deprecated("3.2")
281282
def is_unit(self):
282283
"""Return whether this is the unit box (from (0, 0) to (1, 1))."""
283284
return self.get_points().tolist() == [[0., 0.], [1., 1.]]

lib/mpl_toolkits/mplot3d/axes3d.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@
3232
from . import axis3d
3333

3434

35+
@cbook.deprecated("3.2", alternative="Bbox.unit()")
3536
def unit_bbox():
3637
box = Bbox(np.array([[0, 0], [1, 1]]))
3738
return box
@@ -82,10 +83,10 @@ def __init__(
8283
self.initial_elev = elev
8384
self.set_proj_type(proj_type)
8485

85-
self.xy_viewLim = unit_bbox()
86-
self.zz_viewLim = unit_bbox()
87-
self.xy_dataLim = unit_bbox()
88-
self.zz_dataLim = unit_bbox()
86+
self.xy_viewLim = Bbox.unit()
87+
self.zz_viewLim = Bbox.unit()
88+
self.xy_dataLim = Bbox.unit()
89+
self.zz_dataLim = Bbox.unit()
8990
# inhibit autoscale_view until the axes are defined
9091
# they can't be defined until Axes.__init__ has been called
9192
self.view_init(self.initial_elev, self.initial_azim)

0 commit comments

Comments
 (0)