LinuxでIPython QTコンソールを実行しているIPythonに次のコードがあります。
%pylab inline
Welcome to pylab, a matplotlib-based Python environment [backend: module://IPython.zmq.pylab.backend_inline].
For more information, type 'help(pylab)'.
fig = figure()
ax = fig.add_axes()
ax = fig.add_axes([0,500, 0, 5000])
ax.plot([1,2,3,44], [4,4,55,55])
Out[5]: [<matplotlib.lines.Line2D at 0x3d8e7d0>]
fig
Out[6]: <matplotlib.figure.Figure at 0x3d25fd0>
fig.show()
/usr/lib/pymodules/python2.7/matplotlib/figure.py:362: UserWarning: matplotlib is currently using a non-GUI backend, so cannot show the figure
"matplotlib is currently using a non-GUI backend, "
私はしばらくの間、これを機能させるのに苦労してきました。バックエンドを手動でmatplotlib.use()
toなどに変更しようとしましたがQt4Agg
、GTK
うまくいきませんでした。これはIPython notebook
、 を呼び出した場合でも発生しますdisplay()
。
インラインプロットを機能させる方法はありますか?
ヤコブの答えを答えとしてマークしましたが、実際にはどちらも真実です。matploblibrc ファイルを新しいコピーに置き換え、IPython QT コンソールを --pylab=None で起動し、コンソールに %pylab inline を手動で入力する必要がありました。どういうわけか、これで問題が解決しました。