美文网首页
jupyter notebook中matplotlib绘图包的中

jupyter notebook中matplotlib绘图包的中

作者: nlpjoe | 来源:发表于2018-08-19 13:27 被阅读28次

方法1,root态安装

  1. 停止Jupyter
  2. 安装 font-manager: sudo apt install font-manager
  3. 清除matplotlib cache directory: rm ~/.cache/matplotlib -fr
  4. 重启Jupyter.

方法2,用户态安装

1. 查找matplotlib路径

import matplotlib
matplotlib.matplotlib_fname()

输出路径大致如下,记住,第2步会使用:

'xxx/matplotlib/mpl-data/matplotlibrc'

2. 安装SimHei字体

字体链接:百度网盘 密码:5vn4

字体放到xxx/matplotlib/mpl-data/ttf下即可

3. 修改配置文件

vim 打开xxx/matplotlib/matplotlibrc,添加内容如下:

image

4. 删除缓存

rm ~/.cache/matplotlib -fr

重启jupyter即可。

相关文章

网友评论

      本文标题:jupyter notebook中matplotlib绘图包的中

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