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

2018-11-09  本文已影响0人  LiWei_9e4b

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即可

上一篇 下一篇

猜你喜欢

热点阅读