From: JaeJoon Lee <lee.j.joon@gm...>  20090115 23:01:16

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) Take a look at the documentation for more details. JJ On Thu, Jan 15, 2009 at 3:54 PM, <projetmbc@...> wrote: > Indeed I would also use mpl to have png of formulas so as to put them in a > HTML page. > > C. > > >>va="baseline" does not work? >> >>JJ >> >> >>On Thu, Jan 15, 2009 at 3:05 AM, <projetmbc@...> wrote: >>>>Dimension of a text in mpl is rendererdependent in general. >>>>Each renderer has "get_text_width_height_descent" method which > returns >>>>width, height, and descent of the given text. >>>>If you're only interested in latexrendered text, you may use the >>>>get_text_width_height_descent() method in the TexManager. >>>> >>>>As you see, it is possible to know the dimension of the text, but >>>>these functionalities are not exposed to the user, and a bit difficult >>>> to use unless you're familiar with mpl. If you let us know for what >>>>you need to use the depth of the text, we may come up with some > simple >>>>solution. >>>> >>>>Regards, >>>> >>>>JJ > > 