为内联Retina Matplotlib数据配置Jupyter笔记本

oro*_*ome 16 matplotlib ipython python-2.7 retina-display jupyter-notebook

我想要的效果

import numpy as np
import matplotlib.pyplot as plt
%matplotlib inline
%config InlineBackend.figure_format='retina'
Run Code Online (Sandbox Code Playgroud)

在推出我所有的Jupyter笔记本电脑时,我无法弄清楚当前的方法是什么来实现这一目标.这里和其他地方有很多答案,但我找不到任何答案似乎都是最新的.

我如何在当前版本的Jupyter笔记本中完成上述操作(但一般不是IPython!):我应该应用哪些设置应该放在哪个配置文件中?


我试过了

c.InteractiveShellApp.matplotlib = "inline"
c.InlineBackend.figure_formats = set(['retina'])
Run Code Online (Sandbox Code Playgroud)

~/.jupyter/jupyter_notebook_config.py
Run Code Online (Sandbox Code Playgroud)

但这没有效果.

Sha*_*har 7

我有

c.IPKernelApp.matplotlib = 'inline'
c.InlineBackend.figure_format = 'retina'
Run Code Online (Sandbox Code Playgroud)

在我的~/.ipython/profile_default/ipython_kernel_config.py.

  • 你的`〜/ .ipython/profile_default /`中应该有`ipython_kernel_config.py`.你能在终端上运行`ipython profile create`吗?那应该创建所有的配置文件.确保要生效的行已取消注释,并且第一个未注释的行将显示为"c = get_config()". (2认同)