Hi all, I need to mix maths & text in labels such as

> title and xlabel.

> I first tried the most intuitive way:

> title(r"$x$ and $y$")

> but it appeared not to work (don't focus of my silly

> sample title, the real one does make sense

> Then I tried

> title(r"$x$ \text{and} $y$")

> but I got an error related to the fact that

> is_string_like() returned False when passing my title

> string to it.

Currently, matplotlib mathtext handling does not allow "embedded" math

expressions. So the whole expression must be written in math mode.

This is a pain and something we will fix when we can.

In the next release of matplotlib, due out soon, we have support for

mathematical expressions using TeX in the *Agg and PS backends. So if

you have tex (and a few other tools) installed on your systems, you

can use it to render all the text in your matplotlib figure.

In the meantime, you can do something like this

title(r'$x\ \rm{and}\ y$')

JDH