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

Commit9214657

Browse files
committed
BUGFIX: Bbox union and transform, better semantics
1 parent6253d80 commit9214657

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

‎lib/matplotlib/transforms.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -660,10 +660,10 @@ def union(bboxes):
660660
# needed for 1.14.4 < numpy_version < 1.16
661661
# can remove once we are at numpy >= 1.16
662662
withnp.errstate(invalid='ignore'):
663-
x0=np.min([bbox.xminforbboxinbboxes])
664-
x1=np.max([bbox.xmaxforbboxinbboxes])
665-
y0=np.min([bbox.yminforbboxinbboxes])
666-
y1=np.max([bbox.ymaxforbboxinbboxes])
663+
x0=np.min([bbox.x0forbboxinbboxes])
664+
x1=np.max([bbox.x1forbboxinbboxes])
665+
y0=np.min([bbox.y0forbboxinbboxes])
666+
y1=np.max([bbox.y1forbboxinbboxes])
667667
returnBbox([[x0,y0], [x1,y1]])
668668

669669
@staticmethod
@@ -672,10 +672,10 @@ def intersection(bbox1, bbox2):
672672
Return the intersection of *bbox1* and *bbox2* if they intersect, or
673673
None if they don't.
674674
"""
675-
x0=np.maximum(bbox1.xmin,bbox2.xmin)
676-
x1=np.minimum(bbox1.xmax,bbox2.xmax)
677-
y0=np.maximum(bbox1.ymin,bbox2.ymin)
678-
y1=np.minimum(bbox1.ymax,bbox2.ymax)
675+
x0=np.maximum(bbox1.x0,bbox2.x0)
676+
x1=np.minimum(bbox1.x1,bbox2.x1)
677+
y0=np.maximum(bbox1.y0,bbox2.y0)
678+
y1=np.minimum(bbox1.y1,bbox2.y1)
679679
returnBbox([[x0,y0], [x1,y1]])ifx0<=x1andy0<=y1elseNone
680680

681681

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp