I'm intending to write a thesis and am beginning by setting up a standard Matplotlib file to control plot formatting. However, I'm having problems with the text.usetex : True
option. In particular, it's irritating that the tick labels default to a serif font when all my figures should be sans-serif. Indeed - I set the font.family to sans-serif in the rcParams file but still see the problem, as identified in github here.
Additionally, other text looks different when I have usetex
turned on or off - this seems surprising since I told matplotlib to use the same font each time.
Therefore, I wonder what the actual benefit to using LaTeX rendering is? Since Matplotlib can already handle LaTeX commands in labels such as xlabel('\alpha')
and can accept fonts to use by user input to the rcparams file, what does using LaTeX on the text do differently?
To achieve my aim of a consistent sans-serif font, could I not just set font.sans-serif in matplotlib rcparams file to be the font I set as a sans-serif font in LaTeX?
Thanks for any suggestions or hints!