findfont: Font family [‘sans-serif‘] not found. Falling back to DejaVu Sans.

import matplotlib
print(matplotlib.matplotlib_fname())

显示结果

/home/dell/anaconda3/envs/yolo/lib/python3.8/site-packages/matplotlib/mpl-data/matplotlibrc

在font字体中加入sans-serif字体,注意名称要一模一样

matplotlibrc中加了#的font.family等不用取消注释

猜你喜欢

转载自blog.csdn.net/qq_16792139/article/details/114096774
今日推荐