learn-NLP-luhuibo icon indicating copy to clipboard operation
learn-NLP-luhuibo copied to clipboard

解决notebook中matplotlib显示中文问题

Open Valuebai opened this issue 5 years ago • 0 comments

# 解决matplotlib显示中文问题
# 仅适用于Windows
plt.rcParams['font.sans-serif'] = ['SimHei']  # 指定默认字体
plt.rcParams['axes.unicode_minus'] = False  # 解决保存图像是负号'-'显示为方块的问题

# MacOS请参考 http://wenda.chinahadoop.cn/question/5304 修改字体配置

Valuebai avatar Dec 17 '19 00:12 Valuebai