更新后的问题 ipython (%matplotlib nbagg)

Troubles after updating ipython (%matplotlib nbagg)

我安装了 anaconda 发行版,我通常 运行 ipython notebook --pylab inline。我使用 pip install (windows 8.1) 更新了 ipython,我不再需要编写 --pylab inline 来启动了

我开始在单元格中写:%matplotlib nbaggmatplotlib.use['nbagg'],但是当我绘制一些东西时它显示这个空框:

我期待交互式绘图框。

ipython 日志显示:

[IPKernelApp] ERROR | No such comm: 7cfe982045bb4d0db0f14deff7258130

我猜这个问题是由于 matplotlib 的版本太旧造成的。使用 %matplotlib nbaggipython>=3.0 需要 matplotlib>=1.4.3(注意 %matplotlib notebook%matplotlib nbagg 现在是同义词)。

通过 pip install --upgrade matplotlib 更新 matplotlib 可能会解决这个问题。另见我在 github 上的 issue-7797。感谢 jenshnielsen 提供此信息。

应该同时更新 matplotlib 和 ipython...

sudo pip install -U ipython
sudo pip install -U matplotlib

在 windows 上:

pip install --upgrade matplotlib
pip install --upgrade ipython