[Bug]: Warning: Font Family not found · Issue #20850 · matplotlib/matplotlib · GitHub
Skip to content

[Bug]: Warning: Font Family not found #20850

Description

@FranzForstmayr

Bug summary

Usign Latex fonts as recommended here throws a Warning:

findfont: Font family ['serif'] not found. Falling back to DejaVu Sans.
findfont: Generic family 'serif' not found because none of the following families were found: 

Code for reproduction

import matplotlib.pyplot as plt

plt.rcParams.update({
    "font.family": "serif",
    # Use LaTeX default serif font.
    "font.serif": [],
    # Use specific cursive fonts.
    "font.cursive": ["Comic Neue", "Comic Sans MS"],
})

plt.figure()
plt.plot([1,2,3,4])
plt.savefig('test.png')
plt.savefig('test.pgf')

Actual outcome

The Bug is also visible in your Docs.
https://matplotlib.org/stable/gallery/userdemo/pgf_fonts.html

Expected outcome

No Warning should get thrown everytime

Operating system

Ubuntu

Matplotlib Version

3.4.2

Matplotlib Backend

TkAgg

Python version

3.9.5

Jupyter version

No response

Other libraries

No response

Installation

pip

Conda channel

No response

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions