Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Computer Modern Glyph Error #17007

Closed
@roussel-ryan

Description

@roussel-ryan

Bug report

Trying to use computer modern roman (cmr10) font in plot. Getting an error which prevents minus sign rendering in plot.

import matplotlib as mpl
import matplotlib.pyplot as plt

mpl.rc('font',family = 'serif', serif = 'cmr10')
fig, ax = plt.subplots()

ax.set_title('This is a special font:')
ax.set_xlabel(r'This is the default font $\alpha\beta\gamma$')
ax.set_yticks([-1,0,1])
plt.show()

Figure_1

Output:

C:\ProgramData\Anaconda3\lib\site-packages\matplotlib\backends\backend_agg.py:214: RuntimeWarning: Glyph 8722 missing from current font.
  font.set_text(s, 0.0, flags=flags)
C:\ProgramData\Anaconda3\lib\site-packages\matplotlib\backends\backend_agg.py:183: RuntimeWarning: Glyph 8722 missing from current font.
  font.set_text(s, 0, flags=flags)

Expected outcome
Correct rendering of symbols

Matplotlib version

  • Operating system: Cygwin / Windows10 Enterprise 64 Bit
  • Matplotlib version: 3.2.1
  • Matplotlib backend (print(matplotlib.get_backend())):
  • Python version: 3.7.7
  • Jupyter version (if applicable): N/A
  • Other libraries:

Installed matplotlib via anaconda on default channel

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions