<div dir="ltr">Thanks Eric. That makes sense.<div>George</div></div><div class="gmail_extra"><br><div class="gmail_quote">On 4 March 2015 at 19:53, Eric Firing <span dir="ltr"><<a href="mailto:efiring@hawaii.edu" target="_blank">efiring@hawaii.edu</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">George,<br>
<br>
The problem is that clicking the red X is closing the figure, and the<br>
call in the next cell is trying to plot to that closed figure.  The<br>
solution is to open a new figure in each cell where you want to plot to<br>
a new figure. You can use plt.figure(), or use "fig, ax =<br>
plt.subplots()" and then "ax.plot(...)" etc.<br>
<br>
Eric<br>
<div><div class="h5"><br>
On 2015/03/04 12:29 AM, George Nurser wrote:<br>
> Hi,<br>
><br>
> Not sure whether this is an python or matplotlib query.<br>
><br>
> Using the latest python v3.0.1 and matplotlib 1.4.3 from macports on OS<br>
> X 10.9.5, python 2.7.9,<br>
> I invoke ipython with<br>
><br>
> ipython notebook<br>
><br>
> Then in a new 'Jupyter' notebook I create on  Safari 7.1.3 I do<br>
><br>
> %matplotlib nbagg<br>
><br>
> import matplotlib.pyplot as plt<br>
><br>
> plt.plot([1,2])<br>
><br>
> -- this works great, but if I click on the red x to the top right then<br>
><br>
> (i) I get the warning message on the console of<br>
> [IPKernelApp] ERROR | No such comm: 42451f0dd4314048908b43c2e4c414bf<br>
><br>
> (ii) all future calls to matplotlib don't actually plot anything. e.g.<br>
> (both in the original cell and in new cells below in the notebook) doing<br>
> plt.plot([1,2]) just gives<br>
><br>
> Out[5]:  [<matplotlib.lines.Line2D at 0x1104fa9d0>]<br>
><br>
> I can get things to work again with another call of<br>
> %matplotlib nbagg<br>
> but just wondered whether it was supposed to work like this.<br>
><br>
> I had similar issues with python 2.4 and matplotlib 1.4.2<br>
><br>
> Regards, George Nurser.<br>
><br>
><br>
><br>
><br>
</div></div>> _______________________________________________<br>
> IPython-dev mailing list<br>
> <a href="mailto:IPython-dev@scipy.org">IPython-dev@scipy.org</a><br>
> <a href="http://mail.scipy.org/mailman/listinfo/ipython-dev" target="_blank">http://mail.scipy.org/mailman/listinfo/ipython-dev</a><br>
><br>
<br>
_______________________________________________<br>
IPython-dev mailing list<br>
<a href="mailto:IPython-dev@scipy.org">IPython-dev@scipy.org</a><br>
<a href="http://mail.scipy.org/mailman/listinfo/ipython-dev" target="_blank">http://mail.scipy.org/mailman/listinfo/ipython-dev</a><br>
</blockquote></div><br></div>