Loading

matplotlib 字体

linux 平台 matplotlib 字体报错如下:

Font family ['Times New Roman'] not found.

解决步骤:

  1. step 1
conda install -c conda-forge -y mscorefonts
  1. step 2
import matplotlib
matplotlib.font_manager._rebuild()
  1. step 3
rm ~/.cache/matplotlib -rf

参考

https://stackoverflow.com/questions/42097053/matplotlib-cannot-find-basic-fonts

posted @ 2022-11-26 10:12  lif323  阅读(82)  评论(0)    收藏  举报