2022-5-7
客户说他的Mac 上matplotlib.plt图表乱码

网上找了很多方法,1.下载字体,2.修改matplotlibrc文件,3.重新安装matplotlib都不行
最好使用了这个方法解决
import matplotlib.pyplot as plt
plt.rcParams['font.sans-serif'] = ['Arial Unicode MS']
这篇博客讲述了用户在Mac上使用matplotlib绘制图表遇到乱码问题,分享了通过设置`plt.rcParams['font.sans-serif']=['ArialUnicodeMS']`来解决的方法。尝试了多种途径如下载字体、修改matplotlibrc和重装包后,最终这个简单设置解决了问题。
客户说他的Mac 上matplotlib.plt图表乱码

网上找了很多方法,1.下载字体,2.修改matplotlibrc文件,3.重新安装matplotlib都不行
最好使用了这个方法解决
import matplotlib.pyplot as plt
plt.rcParams['font.sans-serif'] = ['Arial Unicode MS']
602

被折叠的 条评论
为什么被折叠?