Vertical alignment of a text

Flashmail
Thanks, that’s work well.

Regards.

C.

···

I presume that you’re only interested in the math formula, and not in
any other graphical functionality of MPL. You may use mathtext module
directly in that case.

from matplotlib.mathtext import MathTextParser

p = MathTextParser(“bitmap”)
filename, texstr = “test.png”, r"$\alpha$"
p.to_png(filename, texstr)
d = p.get_depth(texstr)