I want part of a matplotlib plot title be both bold and italicized, while the rest of the plot title is just bold. Matplotlib apparently doesn’t recognize LaTeX functions like textbf, while for other functions (bf, it, etc), it only accepts whichever is most recent, regardless of nesting syntax (i.e. $bf{it{foo}}
).
This is the code I’ve tried.
plot_title = r'$textbf{textit{foo}}$ bar'
plt.title(plot_title, y=plot_title_vertical_position, x=plot_title_horizontal_position, fontweight = 'bold', fontsize=plot_title_fs)
I’ve played around with different combinations of LaTeX bold and italics font functions (bf, it, mathbf, mathit), and with removing the fontweight = ‘bold’ command.
Any workarounds?