Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork7.9k
Description
Bug report
Bug summary
A pgf image exported by matplotlib leads to two different fonts in the x- and y-axis in alatex document
Code for reproduction
First you have to create the figure with the following code or a similar one.
importmatplotlibasmplmpl.rcParams["axes.formatter.use_mathtext"]=Falseimportmatplotlib.pyplotaspltplt.close()plt.semilogy(3.5,3.5e3,"o")plt.savefig("test.pdf")plt.savefig("test.pgf")
Then you put thepgf
figure into a latex document:
\documentclass{scrartcl}\usepackage{pgf}\begin{document}\input{test.pgf}\end{document}
Actual outcome
Latex produces a pdf document with the y-axis in roman font (computer modern roman) and the x-axis in a sans-serif font (computer modern sans). I had expected both axes to have the same font.
Thepdf produced by matplotlib in contrast has the sans-serif font for both axes.
Expected outcome
I would expected both axes to have a sans-serif font like in the pdf produced by matplotlib itself. However, I'm not sure if this is more latex related.
I also found a similar question onstackoverflow.
Matplotlib version
- Operating system: Ubuntu 18.04.2
- Matplotlib version: 3.1.0
- Matplotlib backend: TkAgg
- Python version: 3.6.8
- Jupyter version (if applicable): not important
- Other libraries: pdfTex 3.14159265-2.6-1.40.18 (TeX Live 2017/Debian)