<div dir="ltr">Jandyman,<div><br></div><div> The short answer: something has to run the GUI event loop while the prompt is waiting for user input.  This is typically called an "input hook".<br><div><br></div><div>For a long answer see <a href="https://github.com/matplotlib/matplotlib/pull/4779">https://github.com/matplotlib/matplotlib/pull/4779</a> . </div></div><div><br></div><div>Unfortunately I am not familiar enough with vscode's debug mode to provide any guidance on how to configure it in that context.</div><div><br></div><div>Tom</div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Thu, Feb 6, 2020 at 8:41 PM jandyman <<a href="mailto:andy@voelkel.us">andy@voelkel.us</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Hi,<br>
<br>
I've spent several hours trying to figure out how to get interactive plots<br>
to work on MacOS Catalina (plots which don't block program execution). I got<br>
fairly excited when I found instructions in the Matplotlib docs for using<br>
python as a framework and then using the macosx backend, but it doesn't seem<br>
to help. I'm operating in debug mode from Visual Studio Code, which<br>
otherwise seems to work well. Here's the code:<br>
<br>
import matplotlib.pyplot as plt<br>
import matplotlib<br>
import numpy as np<br>
<br>
matplotlib.use("macosx")<br>
plt.ion()<br>
x = np.linspace(0, 20, 100)  # Create a list of evenly-spaced numbers over<br>
the range<br>
plt.plot(x, np.sin(x))       # Plot the sine of each x point<br>
plt.show() <br>
# put a breakpoint on this next line <br>
y = 5<br>
<br>
If I omit the call to plt.ion(), I get a plot that blocks program execution<br>
until I close the plot window, so I don't hit the breakpoint until the plot<br>
is gone. If I leave the call to plot.ion() in, I hit the breakpoint, but no<br>
plot is shown.<br>
<br>
Does anyone know if is possible to get this to work, and if so, how? I've<br>
got this sort of thing to work before with Spyder, but it is hinky, and I've<br>
got other issues with Spyder. I'm just chasing the sort of user experience I<br>
used to have with Matlab, only with Python, which I like better as a<br>
language.<br>
<br>
A lot of folks seems to use Jupyter for this sort of thing, and Jupyter is<br>
great for what it does, but it isn't what I'm trying to do.<br>
<br>
<br>
<br>
--<br>
Sent from: <a href="http://matplotlib.1069221.n5.nabble.com/matplotlib-users-f3.html" rel="noreferrer" target="_blank">http://matplotlib.1069221.n5.nabble.com/matplotlib-users-f3.html</a><br>
_______________________________________________<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" rel="noreferrer" target="_blank">https://mail.python.org/mailman/listinfo/matplotlib-users</a><br>
</blockquote></div><br clear="all"><div><br></div>-- <br><div dir="ltr" class="gmail_signature">Thomas Caswell<br><a href="mailto:tcaswell@gmail.com" target="_blank">tcaswell@gmail.com</a></div>