美文网首页
解决ubuntu中jupyter中文及"-"乱码显示问题

解决ubuntu中jupyter中文及"-"乱码显示问题

作者: LiWei_9e4b | 来源:发表于2018-11-09 17:07 被阅读0次

1.下载正确下载字体文件simhei.ttf(选择中文格式)
2.将上面下载的文件copy到matplotlib里的对应目录,我的目录是:
/home/anaconda3/lib/python3.6/site-packages/matplotlib/mpl-data/fonts/ttf
3.修改/home/anaconda3/lib/python3.6/site-packages/matplotlib/mpl-data/matplotlibrc文件.修改为:
199行去掉#
font.family : sans-serif
211行去掉#, 在:后添加simhei
font.sans-serif : simhei,DejaVu Sans,
330行修改为:
axes.unicode_minus : False
4.home目录下搜fontList.json,删除,重启jupyter即可

相关文章

网友评论

      本文标题:解决ubuntu中jupyter中文及"-"乱码显示问题

      本文链接:https://www.haomeiwen.com/subject/btplxqtx.html