<div dir="ltr">That is at least all consistent!  The issue as that for what ever reason the input hook is not being set up correctly (which is what lets the GUI event loop spin and process events while the terminal waits for you to type).  With `plt.ion()` the terminal is blocking the process waiting for you to type (which is why the window is not responding), with `plt.ioff()` when you do `plt.show()` the GUI event loop is blocking the process (which is why it works, but you don't get the next prompt back until you close the plot window).  Again, see <a href="https://github.com/matplotlib/matplotlib/pull/4779">https://github.com/matplotlib/matplotlib/pull/4779</a> for a longer pass at explaining how this all works (and I would appreciate feed back about where it does not make sense!).<div><br><div>Try using `tkagg` as the backend, the integration between python and tk in a bit tighter (because it is done in the cpython source). </div><div><br></div><div>Which version of IPython and matplotlib are you using (and are you sure that elpy is using the versions you think it is?)?</div><div><br></div><div>are you using `(elpy-use-ipython)` or just hacking the python executable path?</div><div><br></div><div>You are siting at a very interesting intersection of technology here (emacs + python + GUI + windows).  It might make sense to ask either on the elpy mailing list or the ipython mailing list.</div></div><div><br></div><div>Tom</div></div><br><div class="gmail_quote"><div dir="ltr">On Sat, Aug 19, 2017 at 3:28 PM Strozzi, David J. <<a href="mailto:strozzi2@llnl.gov">strozzi2@llnl.gov</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">





<div lang="EN-US" link="blue" vlink="purple">
<div class="m_-7380249229202294694WordSection1">
<p class="MsoNormal">Hi,<u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal">* Just subscribed to list.<u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal">* Backend: mpl.get_backend() = ‘Qt5Agg’.  I am not committed to this if another one will work.<u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal">* “If you get up a window:” I start ipython within emacs (the GNU win32 build, not cygwin), and do figure(1), a figure window appears, but nothing renders, and window title bar says “Not responding.”  If I plot something, it doesn’t appear.<u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal">fig is not defined, by default.  I can do fig=gcf().  Then fig.canvas.flush_events() has an interesting effect – the plot appears, but then window title still says “not responding” and when I hover the mouse over the figure window it becomes
 Windows’ spinning blue circle (the busy symbol, like Mac’s spinning beachball).<u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal">“control” is returned to ipython.  I can continue to execute commands there.<u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal">* At this point, plt.ioff() doesn’t seem to do anything.  plt.show() does – “not responding” disappears, the figure window works like normal.  Buttons on it work.  But the ipython window is “frozen” no In[] prompt.<u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal">OK so this seems like a lot of information.  Maybe we can make progress?<u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal">Dave<u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal"></p></div></div><div lang="EN-US" link="blue" vlink="purple"><div class="m_-7380249229202294694WordSection1"><p class="MsoNormal"><b>From:</b> Thomas Caswell [mailto:<a href="mailto:tcaswell@gmail.com" target="_blank">tcaswell@gmail.com</a>] <br>
</p></div></div><div lang="EN-US" link="blue" vlink="purple"><div class="m_-7380249229202294694WordSection1"><p class="MsoNormal"><b>Sent:</b> Saturday, August 19, 2017 10:54 AM</p></div></div><div lang="EN-US" link="blue" vlink="purple"><div class="m_-7380249229202294694WordSection1"><p class="MsoNormal"><br>
<b>To:</b> Strozzi, David J. <<a href="mailto:strozzi2@llnl.gov" target="_blank">strozzi2@llnl.gov</a>>; <a href="mailto:matplotlib-users@python.org" target="_blank">matplotlib-users@python.org</a><br>
<b>Subject:</b> Re: [Matplotlib-users] Windows7: figure window "not responding"<u></u><u></u></p></div></div><div lang="EN-US" link="blue" vlink="purple"><div class="m_-7380249229202294694WordSection1">
<p class="MsoNormal"><u></u> <u></u></p>
<div>
<p class="MsoNormal">David,<u></u><u></u></p>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
<div>
<p class="MsoNormal">Please subscribe to the mailing list so you can post un-moderated.<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
<div>
<p class="MsoNormal">Which backend are you using?<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
<div>
<p class="MsoNormal">If you get a window up and then do `fig.canvas.flush_events()` will it update?<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
<div>
<p class="MsoNormal">If you do `plt.ioff()` and then `plt.show()` does it work?<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
<div>
<p class="MsoNormal">Tom<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
</div>
<p class="MsoNormal"><u></u> <u></u></p>
<div>
<div>
<p class="MsoNormal">On Sat, Aug 19, 2017 at 12:40 PM Strozzi, David J. <<a href="mailto:strozzi2@llnl.gov" target="_blank">strozzi2@llnl.gov</a>> wrote:<u></u><u></u></p>
</div>
<blockquote style="border:none;border-left:solid #cccccc 1.0pt;padding:0in 0in 0in 6.0pt;margin-left:4.8pt;margin-right:0in">
<div>
<div>
<p class="MsoNormal">Thanks for the respone.  Sadly, I can’t get anything useful out of the doc.  And %matplotlib doesn’t help, same effect.<u></u><u></u></p>
<p class="MsoNormal"> <u></u><u></u></p>
<p class="MsoNormal">This is very frustrating.  I don’t know how to debug this.  It’s just a “black box”, I do what I’m “supposed to”, doesn’t work.<u></u><u></u></p>
<p class="MsoNormal"> <u></u><u></u></p>
<p class="MsoNormal">Help appreciated!<u></u><u></u></p>
<p class="MsoNormal">Dave<u></u><u></u></p>
<p class="MsoNormal"> <u></u><u></u></p>
<p class="MsoNormal"><b>From:</b> Thomas Caswell [mailto:<a href="mailto:tcaswell@gmail.com" target="_blank">tcaswell@gmail.com</a>]
<br>
<b>Sent:</b> Saturday, August 05, 2017 10:36 AM<br>
<b>To:</b> Strozzi, David J. <<a href="mailto:strozzi2@llnl.gov" target="_blank">strozzi2@llnl.gov</a>>;
<a href="mailto:matplotlib-users@python.org" target="_blank">matplotlib-users@python.org</a><br>
<b>Subject:</b> Re: [Matplotlib-users] Windows7: figure window "not responding"<u></u><u></u></p>
</div>
</div>
<div>
<div>
<p class="MsoNormal"> <u></u><u></u></p>
<div>
<p class="MsoNormal">I do exactly this as well (but on linux)!<u></u><u></u></p>
<div>
<p class="MsoNormal"> <u></u><u></u></p>
</div>
<div>
<p class="MsoNormal">The symptoms your are describing sounds like the GUI event loop is not being spun behind the scenes (see <a href="https://github.com/matplotlib/matplotlib/pull/4779" target="_blank">https://github.com/matplotlib/matplotlib/pull/4779</a> for
 some draft text at explaining how all of that works).  Have you tried doing `%matplotlib` is IPython?  <u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"> <u></u><u></u></p>
</div>
<div>
<p class="MsoNormal">Tom<u></u><u></u></p>
</div>
</div>
<p class="MsoNormal"> <u></u><u></u></p>
<div>
<div>
<p class="MsoNormal">On Sat, Aug 5, 2017 at 12:39 PM Strozzi, David J. <<a href="mailto:strozzi2@llnl.gov" target="_blank">strozzi2@llnl.gov</a>> wrote:<u></u><u></u></p>
</div>
<blockquote style="border:none;border-left:solid #cccccc 1.0pt;padding:0in 0in 0in 6.0pt;margin-left:4.8pt;margin-top:5.0pt;margin-right:0in;margin-bottom:5.0pt">
<div>
<div id="m_-7380249229202294694m_2691066348535366900m_5400856808711202163divtagdefaultwrapper">
<p><span style="font-size:12.0pt;color:black">This problem has been driving me nuts, posted it elsewhere, so far no one's been able to help.  I am running Python 3.6.1 from Anaconda (all packages updated to latest and greatest) on Windows 7.  ipython and mpl
 figure windows work fine from a console, or spyder.  The problem is when I try running ipython within emacs using elpy.</span><u></u><u></u></p>
<p><span style="font-size:12.0pt;color:black"> </span><u></u><u></u></p>
<p><span style="font-size:12.0pt;color:black">To back up, the workflow I'm shooting for is using emacs as my IDE, and running python within emacs.  I've done this for many years with the Yorick interpreter, and it's quite addictive.  I get the same problem
 whether I use the GNU windows build of emacs, or emacs -nw (terminal, no X) from cygwin (ver 25.2 both cases).  elpy seems to be a good Python package for emacs, and nominally supports using ipython.</span><u></u><u></u></p>
<p><span style="font-size:12.0pt;color:black"> </span><u></u><u></u></p>
<p><span style="font-size:12.0pt;color:black">OK, so - I can use ipython + emacs + elpy.  The only problem is matplotlib figures.  When I do figure(), a figure window appears, but is not fully rendered (e.g. no buttons), and the window title says "Not responding". 
 If I do a plot(), nothing is plotted.  Playing with ion() and show() doesn't help.</span><u></u><u></u></p>
<p><span style="font-size:12.0pt;color:black"> </span><u></u><u></u></p>
<p><span style="font-size:12.0pt;color:black">I've posted this on the elpy github, various stackexchange forums, no one has had any ideas yet.</span><u></u><u></u></p>
<p><span style="font-size:12.0pt;color:black"> </span><u></u><u></u></p>
<p><span style="font-size:12.0pt;color:black">Any help is greatly appreciated!</span><u></u><u></u></p>
<p><span style="font-size:12.0pt;color:black">Dave</span><u></u><u></u></p>
</div>
</div>
<p class="MsoNormal">_______________________________________________<br>
Matplotlib-users mailing list<br>
<a href="mailto:Matplotlib-users@python.org" target="_blank">Matplotlib-users@python.org</a><br>
<a href="https://mail.python.org/mailman/listinfo/matplotlib-users" target="_blank">https://mail.python.org/mailman/listinfo/matplotlib-users</a><u></u><u></u></p>
</blockquote>
</div>
</div>
</div>
</blockquote>
</div>
</div></div></blockquote></div>