Matplotlib: formatting text without LaTeX

I want to add a text box to a matplotlib chart in Python. The first line of text should be in bold and the second should be underlined. So far, I have managed to do this with LaTeX as follows:

pylab.text(120, 200, r'\textbf{' + str(label['1000'][0]) + '}\n' + '\underline{' + str(label['1000'][1]) + '}', **alignment)

with

rc('text', usetex = True)

However, this means that the script depends on the installation of LaTeX, which I would prefer to avoid to make it more convenient for use by less experienced users.

Is there any way to do this?

Thank!

+4
source share

All Articles