vim /home/wangxv/Files/compete/tzb/venv/lib/python3.11/site-packages/matplotlib/mpl-data/matplotlibrc
修改以下配置 (注意更改SimHei为你的字体文件名)
#font.family: sans-serif
↓
font.family: sans-serif
#font.serif: DejaVu Serif, Bitstream Vera Serif, Computer Modern Roman, New Century Schoolbook, Century Schoolbook L, Utopia, ITC Bookman, Bookman, Nimbus Roman No9 L, Times New Roman, Times, Palatino, Charter, serif
↓
font.serif: SimHei, DejaVu Serif, Bitstream Vera Serif, Computer Modern Roman, New Century Schoolbook, Century Schoolbook L, Utopia, ITC Bookman, Bookman, Nimbus Roman No9 L, Times New Roman, Times, Palatino, Charter, serif
#axes.unicode_minus: True # use Unicode for the minus symbol rather than hyphen. See# https://en.wikipedia.org/wiki/Plus_and_minus_signs#Character_codes
↓
axes.unicode_minus: False # use Unicode for the minus symbol rather than hyphen. See# https://en.wikipedia.org/wiki/Plus_and_minus_signs#Character_codes