Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit b200f02

Browse files
authored
Merge pull request #26028 from anntzer/gtwhd
Better document the semantics of get_text_width_height_descent.
2 parents 2f1188d + 5d480c5 commit b200f02

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

lib/matplotlib/backend_bases.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -636,9 +636,10 @@ def _draw_text_as_path(self, gc, x, y, s, prop, angle, ismath):
636636

637637
def get_text_width_height_descent(self, s, prop, ismath):
638638
"""
639-
Get the width, height, and descent (offset from the bottom
640-
to the baseline), in display coords, of the string *s* with
641-
`.FontProperties` *prop*.
639+
Get the width, height, and descent (offset from the bottom to the baseline), in
640+
display coords, of the string *s* with `.FontProperties` *prop*.
641+
642+
Whitespace at the start and the end of *s* is included in the reported width.
642643
"""
643644
fontsize = prop.get_size_in_points()
644645

0 commit comments

Comments
 (0)