0
votes

I am using matplotlib.rc('text', usetex=True); matplotlib.rc('font', family='serif') to set my font to serif with LaTeX. This works for the tick labels, however the plot title and axis lables are typeset using the sans-serif CMS S 12 computer modern variant.

From what I have found on the web, most people seem to have trouble using the sans-serif font. For me the opposite is the case, I cannot get the serif font to work properly.

I have tried a hacky solution of setting the sans-serif font to Computer Modern, which unfortunately does not work either.

1
Please provide a minimal reproducible example of the issue together with an image of the output. Also state your version of matplotlib.ImportanceOfBeingErnest

1 Answers

1
votes

I was importing the seaborn package after setting the matplotlib rcParams, which overwrote values such as the font family. Calling rcParams.update(params) after importing seaborn fixes the problem.