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

Skip to content

Commit 575a855

Browse files
windowextent-for-annotationbbox
1 parent 9f0afd2 commit 575a855

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed

lib/matplotlib/offsetbox.py

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

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

0 commit comments

Comments
 (0)
0