Discussion:
[Matplotlib-users] Mixing bold and regular text
Michiel de Hoon
2015-03-22 02:41:34 UTC
Permalink
Dear all,

Is there a way to combine bold and regular text in matplotlib?
I would like to do something like

text(0,0, "Some regular text 123 \bf{some bold text 456}")

I tried to use mathtext as follows

text(0,0,'$\\mathdefault{\mathrm{some plain text-123 }\\mathbf{some bold text-456}}$')

but this treats all text as math, so spaces are lost, hyphens become minus signs, and numbers are not in bold.

Thanks!

Best,
-Michiel

Loading...