私はJupyterコンソールを初めて試していますが、%matplotlib inline
のマジックを動作させることはできません。以下は、セッション例のスクリーンショットです:%matplotlib inlineはiPythonとJupyterコンソールでは動作しません
私が6行目を実行した後、別のウィンドウにプロットが表示され、7行目は何もしません。私は%matplotlib --list
を実行すると
、inline
は、オプションの1つとして与えられている:私は別のバックエンドを使用しようとすると
Available matplotlib backends: ['osx', 'qt4', 'qt5', 'gtk3', 'notebook', 'wx', 'qt',
'nbagg', 'agg', 'gtk', 'tk', 'ipympl', 'inline']
、qt5
言う私はQtがインストールされていないので、それはエラーメッセージを表示します。
ImportError: Matplotlib qt-based backends require an external PyQt4, PyQt5, or PySide
package to be installed, but it was not found.
%matplotlib??
を実行すると、読み取ります
If you are using the inline matplotlib backend in the IPython Notebook
you can set which figure formats are enabled using the following::
In [1]: from IPython.display import set_matplotlib_formats
In [2]: set_matplotlib_formats('pdf', 'svg')
The default for inline figures sets `bbox_inches` to 'tight'. This can
cause discrepancies between the displayed image and the identical
image created using `savefig`. This behavior can be disabled using the
`%config` magic::
In [3]: %config InlineBackend.print_figure_kwargs = {'bbox_inches':None}
をしかし、それは私が私の問題を解決するために周りに微調整することができるものかどうかはわかりません。
魔法のIPythonコンソールを試してみると、inline
はUnknown Backend
です。
UnknownBackend: No event loop integration for u'inline'. Supported event loops are: qt,
qt4, qt5, gtk, gtk2, gtk3, tk, wx, pyglet, glut, osx
私はまた、いくつかは、グーグルの後this issue on githubを見つけたが、私もそれは私の状況に関連していた場合(その会話のほとんどが笑私には意味がありませんでした)知りません。
最後に、この問題がまったく関連しているかどうかはわかりませんが、ちょうどその時です:私がJupyterで!vim
コマンドでVimを開こうとすると、 Jupyter自体から端末を閉じることなく出てくる。しかし、VimはIPythonコンソールの中で呼び出されたときに完璧に動作します。
私はmatplotlib 2.0.0
を使用しています。
誰かが私にこれを理解させる助けがあれば、それはすばらしいでしょう!ありがとうございました!
私が実際に試したときに同じエラーが発生しましたが、どうにかして回避できました。私は正確に何をしたのか覚えていない。とにかくそんなにありがとう、それはとても明白でしたが、なぜ私はそれを理解していないのかわかりません。 – spicypumpkin