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 e7bd831

Browse filesBrowse files
authored
Merge pull request #19641 from soffan-group16/issue19296
Fix Bbox.frozen() not copying minposx/minposy
2 parents e912e8b + 90fcad6 commit e7bd831
Copy full SHA for e7bd831

File tree

Expand file treeCollapse file tree

2 files changed

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

2 files changed

+12
-0
lines changed

‎lib/matplotlib/tests/test_transforms.py

Copy file name to clipboardExpand all lines: lib/matplotlib/tests/test_transforms.py
+6Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -460,6 +460,12 @@ def assert_bbox_eq(bbox1, bbox2):
460460
assert_array_equal(bbox1.bounds, bbox2.bounds)
461461

462462

463+
def test_bbox_frozen_copies_minpos():
464+
bbox = mtransforms.Bbox.from_extents(0.0, 0.0, 1.0, 1.0, minpos=1.0)
465+
frozen = bbox.frozen()
466+
assert_array_equal(frozen.minpos, bbox.minpos)
467+
468+
463469
def test_bbox_intersection():
464470
bbox_from_ext = mtransforms.Bbox.from_extents
465471
inter = mtransforms.Bbox.intersection

‎lib/matplotlib/transforms.py

Copy file name to clipboardExpand all lines: lib/matplotlib/transforms.py
+6Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -807,6 +807,12 @@ def invalidate(self):
807807
self._check(self._points)
808808
super().invalidate()
809809

810+
def frozen(self):
811+
# docstring inherited
812+
frozen_bbox = super().frozen()
813+
frozen_bbox._minpos = self.minpos.copy()
814+
return frozen_bbox
815+
810816
@staticmethod
811817
def unit():
812818
"""Create a new unit `Bbox` from (0, 0) to (1, 1)."""

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.