Movatterモバイル変換


[0]ホーム

URL:


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

Sign up
Appearance settings

Commitce3d45b

Browse files
committed
Deprecate BboxBase.corners.
... which is used only internally in one place, and can be easilyinlined. Possibly in prevision for repurposing the name for otherpurposes.
1 parent04e1332 commitce3d45b

File tree

2 files changed

+9
-3
lines changed

2 files changed

+9
-3
lines changed
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
``BboxBase.corners``
2+
~~~~~~~~~~~~~~~~~~~~
3+
... is deprecated with no replacement.

‎lib/matplotlib/transforms.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -627,6 +627,7 @@ def translated(self, tx, ty):
627627
"""Construct a `Bbox` by translating this one by *tx* and *ty*."""
628628
returnBbox(self._points+ (tx,ty))
629629

630+
@_api.deprecated("3.9")
630631
defcorners(self):
631632
"""
632633
Return the corners of this rectangle as an array of points.
@@ -642,10 +643,12 @@ def rotated(self, radians):
642643
Return the axes-aligned bounding box that bounds the result of rotating
643644
this `Bbox` by an angle of *radians*.
644645
"""
645-
corners=self.corners()
646-
corners_rotated=Affine2D().rotate(radians).transform(corners)
647646
bbox=Bbox.unit()
648-
bbox.update_from_data_xy(corners_rotated,ignore=True)
647+
bbox.update_from_data_xy(
648+
Affine2D().rotate(radians).transform(
649+
[[x0,y0], [x0,y1], [x1,y0], [x1,y1]]),
650+
corners_rotated,
651+
ignore=True)
649652
returnbbox
650653

651654
@staticmethod

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp