I have a list of names like
names = ['a b c', 'd e f', ...]
and I need to print these names in a plot using bold for some of them. So I'm using for example
for k in range(len(names)):
if k in [0,2]:
plt.text(x,y, '$\\bf{' + names[k] + '}$')
else:
plt.text(x,y, names[k])
but in this way names in bold are printed like abc instead of a b c. Of course '$\\bf{names[k]}$' just prints names[k]. What is the correct way of doing this?
I have also tried the answers here link without any luck.
