Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Two different fonts in the axes in pgf images #14637

Copy link
Copy link
Closed as not planned
Closed as not planned
Copy link
@jakobjakobson13

Description

@jakobjakobson13
Issue body actions

Bug report

Bug summary

A pgf image exported by matplotlib leads to two different fonts in the x- and y-axis in a latex document

Code for reproduction
First you have to create the figure with the following code or a similar one.

import matplotlib as mpl
mpl.rcParams["axes.formatter.use_mathtext"] = False
import matplotlib.pyplot as plt

plt.close()
plt.semilogy(3.5, 3.5e3, "o")
plt.savefig("test.pdf")
plt.savefig("test.pgf")

Then you put the pgf 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.
The pdf 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 on stackoverflow.

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)

Metadata

Metadata

Assignees

No one assigned

    Labels

    status: closed as inactiveIssues closed by the "Stale" Github Action. Please comment on any you think should still be open.Issues closed by the "Stale" Github Action. Please comment on any you think should still be open.status: confirmed bugstatus: inactiveMarked by the “Stale” Github ActionMarked by the “Stale” Github Action

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      Morty Proxy This is a proxified and sanitized view of the page, visit original site.