Hi I'm trying to enable bold font for labels in Matplotlib with Latex text rendering. I am able to do this for numerical variables (integers, floats) but failed with string variable.
So this works:
a = 1
plt.plot(X, y, label=r'\textbf{}'.format(a))
but this doesn't:
a = 'text'
plt.plot(X, y, label=r'\textbf{}'.format(a))
I know I can do this:
plt.plot(X, y, label=r'\textbf{text}')
But how can I use the format for a string variable?
Thanks!