I imagine you have had a look at this question (Underlining Text in Python/Matplotlib) If not this would be my first suggestion.
Secondly, I have tried and successfully underlined text. Here is the snippet of code that worked for me:
import numpy as np
import matplotlib.pyplot as plt
plt.rc('text', usetex=True)
x = np.arange(0, 2*np.pi, 0.1)
plt.plot(x, np.sin(x))
plt.text(x[len(x)//2], .5, r'$\underline{sin(x)}$')
plt.show()

Finally, if none of the above have worked, I would suggest looking at your python distribution. Rendering text with LaTeX requires a working LaTeX installation as explained in the matplotlib documentation http://matplotlib.org/users/usetex.html, so this could be one potential issue you are having.
Additionally I would suggest that you add a bit more info on your system & a working snippet of code. This would help narrow down the suggestions/solutions to your problem.