Solve Matplotlib in Times New Roman font can not change the font

Solve Matplotlib in Times New Roman font can not change the font

problem:

When using times new roman font in the drawing, the default is bold, and you can not adjust the thickness of property by weight.

method:

  1. Locate the directory /Users/jc/anaconda3/lib/python3.6/site-packages/matplotlibunder the font_manager.pyfile, which will be weight_dictthe romanproperty commented out.
  2. python code was added matplotlib.font_manager._rebuild()after reconstruction, to display the normal thickness of the Times New Roman font.
Published 28 original articles · won praise 16 · views 3183

Guess you like

Origin blog.csdn.net/Newbie_J/article/details/103529954