How do I change the font of Matplotlib labels including LaTeX parts?

Viewed 40

I am drawing a graph using Matplotlib. As it is being used in a report I want the fonts to match that of the report itself. I've found this method below which works to change the font of the label but it doesn't change the font of the LaTeX part of the label. Is there anyway of changing the LaTeX font style?

import matplotlib.font_manager as fm
prop = fm.FontProperties(fname='/root/Fonts/AdobeDevanagari-Regular.otf')
ax[0].set_ylabel('$\mathrm{\chi}_{v}^{2}$ /-', fontproperties=prop, fontsize = si1)

Also, I want to be able to pick and choose from personal fonts not the prebuilt in ones hence the reason I imported the otf file.

0 Answers
Related