jupyter notebook配置文件路径及插件黑夜模式

1,545 阅读1分钟

jupyter官网

How to install jupyter?

cmd:

pip install -i https://pypi.tuna.tsinghua.edu.cn/simple jupyter

How to run jupyter?

cmd:

jupyter notebook

更改jupyter默认文件路径

  1. C:\Data\strong路径下新建文件夹jupyter file
  2. cmd:
jupyter notebook --generate-config

输出C:\Users\fpp\.jupyter\jupyter_notebook_config.py
3. 打开jupyter_notebook_config.py
4. 将#c.NotebookApp.notebook_dir = ''改为

c.NotebookApp.notebook_dir = 'C:\Data\strong\jupyter file'

注意#要删掉,之后保存

jupyter 插件

install

cmd:

pip install -i https://pypi.tuna.tsinghua.edu.cn/simple jupyter_contrib_nbextensions

cmd:

jupyter contrib nbextension install --user

setting

theme 参考这个

cmd:

pip install -i https://pypi.tuna.tsinghua.edu.cn/simple jupyterthemes

cmd:

jt -t oceans16 -f fira -fs 9 -cellw 97% -ofs 11 -dfs 11 -T

other

tips

matplotlib 矢量图

import matplotlib
import matplotlib.pyplot as plt
%matplotlib inline
%config InlineBackend.figure_format = 'svg'

matplotlib 保存不糊的图

plt.savefig('tmp.pdf', bbox_inches='tight')
plt.show()