from matplotlib.font_manager import FontProperties
font = FontProperties(fname=r'c:\windows\fonts\msyh.ttc', size=20) # 在你电脑里找到的一个支持中文的字体
plt.title(u'三行搞定matplotlib中文乱码', fontproperties=font)
三行搞定matplotlib中文乱码
最新推荐文章于 2023-08-17 18:04:29 发布
from matplotlib.font_manager import FontProperties
font = FontProperties(fname=r'c:\windows\fonts\msyh.ttc', size=20) # 在你电脑里找到的一个支持中文的字体
plt.title(u'三行搞定matplotlib中文乱码', fontproperties=font)