I was trying to use latex to label my plot, some work fine, like:
plt.xlabel('$\omega$')
plt.ylabel('$\mathcal{F}g$')
plt.legend(('$t_{H}=10$', '$t_{H}=20$'), loc = 'best')
but this one does not work:
plt.title('$ \frac{1}{\sqrt \pi t_{H}} \exp(-(\frac{t}{t_{H}})^{2}) $')
it keeps giving me this error:
File "C:\Python27\lib\site-packages\matplotlib\mathtext.py", line 2049, in raise_error
raise ParseFatalException(msg + "\n" + s)
ParseFatalException: Expected end of math '$'
$ rac{1}{\sqrt \pi t_{H}} \exp(-(rac{t}{t_{H}})^{2}) $ (at char 0), (line:1, col:1)
(btw in the given error, there is a box symbol in front of rac which was supposed to be \f)
I don't understand why this does not work but the first one works, can someone help? Thanks!