Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit c0a6527

Browse filesBrowse files
authored
Merge pull request #14537 from anntzer/bbox
API: Slightly tighten the Bbox API.
2 parents a2a41be + c0e2b02 commit c0a6527
Copy full SHA for c0a6527

File tree

Expand file treeCollapse file tree

3 files changed

+12
-4
lines changed
Filter options
Expand file treeCollapse file tree

3 files changed

+12
-4
lines changed
+6Lines 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

Copy file name to clipboardExpand all lines: lib/matplotlib/transforms.py
+1Lines 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

Copy file name to clipboardExpand all lines: lib/mpl_toolkits/mplot3d/axes3d.py
+5-4Lines 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 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.