IPython: Does "%matplotlib inline" required before importing matplotlib?
<p>I am using IPython. Got confused that the codes can't execute if I don't add</p>

<pre><code>%matplotlib
</code></pre>

<p>before </p>

<pre><code>import matplotlib.pyplot as plt
</code></pre>

<p>Could someone enlighten me by explaining why the magic function call in IPython is needed for matplotlib usage?</p>

<p>I believe it's needed because normally matplotlib opens additional windows for graphs using a default toolkit. The %inline lets you load graphs in the IPython notebook, instead of using an external toolkit.</p>

python matplotlib ipython