8000 windowextent-for-annotationbbox · matplotlib/matplotlib@3993fc5 · GitHub
[go: up one dir, main page]

Skip to content

Commit 3993fc5

Browse files
committed
windowextent-for-annotationbbox
1 parent 9f0afd2 commit 3993fc5

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

lib/matplotlib/offsetbox.py

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1494,6 +1494,24 @@ def get_fontsize(self, s=None):
14941494
"""
14951495
return self.prop.get_size_in_points()
14961496

1497+
def get_window_extent(self, renderer):
1498+
"""
1499+
get the bounding box in display space.
1500+
"""
1501+
bboxes = [child.get_window_extent(renderer)
1502+
for child in self.get_children()]
1503+
1504+
return Bbox.union(bboxes)
1505+
1506+
def get_tightbbox(self, renderer):
1507+
"""
1508+
get tight bounding box in display space.
1509+
"""
1510+
bboxes = [child.get_tightbbox(renderer)
1511+
for child in self.get_children()]
1512+
1513+
return Bbox.union(bboxes)
1514+
14971515
def update_positions(self, renderer):
14981516
"""
14991517
Update the pixel positions of the annotated point and the text.

0 commit comments

Comments
 (0)
0