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

Skip to content

Commit 0b55086

Browse files
committed
fixed a bug the get_text_width_height_descent() method of the pdf backend not returning the correct text height.
svn path=/trunk/matplotlib/; revision=6430
1 parent 35f2779 commit 0b55086

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

lib/matplotlib/backends/backend_pdf.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1577,7 +1577,8 @@ def get_text_width_height_descent(self, s, prop, ismath):
15771577
dvi = dviread.Dvi(dvifile, self.dpi)
15781578
page = iter(dvi).next()
15791579
dvi.close()
1580-
return page.width, page.height, page.descent
1580+
# A total height (including the descent) needs to be returned.
1581+
return page.width, page.height+page.descent, page.descent
15811582
if ismath:
15821583
w, h, d, glyphs, rects, used_characters = \
15831584
self.mathtext_parser.parse(s, self.dpi, prop)

0 commit comments

Comments
 (0)