【发布时间】:2014-07-16 18:35:21
【问题描述】:
我正在尝试在 iPython 笔记本(使用 pylab=inline 运行)中显示 pandas 生成的图,但这些图神秘地停止了工作——我将执行以下操作:
In [6]: pd.Series([0,2,4,3,8]).plot()
Out[6]: <matplotlib.axes.AxesSubplot at 0x10e69e110>
<matplotlib.figure.Figure at 0x10eb40d90>
注意:这里没有情节,只有文字。
但是,我确实在运行 iPython 的控制台中遇到了这些错误:
libpng warning: Application built with libpng-1.5.18 but running with 1.6.10
我该如何解决这个问题并让绘图再次工作?
(我通过自制软件安装了 libpng,iPython v.1.1.0,matplotlib v.1.3.1)
更新:现在我正在使用 iPython v.2.1.0。
我仍然得到 libpng 错误,但在笔记本中我现在得到
In [2]: pd.Series([0,2,4,3,8]).plot()
Out[2]: <matplotlib.axes.AxesSubplot at 0x112821110>
/Library/Python/2.7/site-packages/IPython/core/formatters.py:239: FormatterWarning: Exception in image/png formatter: Could not create write struct
FormatterWarning,
<matplotlib.figure.Figure at 0x112788a50>
那么……进展了吗?
(我现在也在文档中使用%pylab inline,而不是将其用作命令行标志。)
【问题讨论】:
-
你试过
%pylab osx吗? -
我做到了。这会在一个单独的窗口中弹出图表,我认为这可行,但实际上并不是一个理想的解决方案。
-
你应该在最新版本的 IPython 上试试这个;尝试使用 conda 安装它:continuum.io/blog/conda
-
好的,现在我使用的是 iPython 2.1(虽然我是通过 pip 安装的)。我得到一个不同的错误(在上面编辑)。
标签: macos matplotlib pandas ipython libpng