On Saturday, March 19, 2016 at 7:36:03 PM UTC-5, Edward K. Ream wrote:
>
> On Saturday, March 19, 2016 at 5:01:55 PM UTC-5, Edward K. Ream wrote:
>
> > The code above only puts up the plot when --ipython is in effect.
>
> No, the example code *does* work just fine, but the plot window does not 
> automatically come to the front. And doh, it would be weird if IPython was 
> required for matplotlib to work!
>

The basic example 
<http://matplotlib.org/1.5.1/examples/animation/basic_example.html> works 
find *without --ipython*, but when run from Leo it generates this message 
in the log pane:

QCoreApplication::exec: The event loop is already running

To suppress this message, add the following code just before the call to 
plt.show(), like this:

plt.ion()# set interactive mode.
plt.show()

So it seems --ipython is useful primarily for long-running computations. 
IPython uses one or more kernels running in separate processes. 

The matplotlib output machinery is very complicated, but surely there must 
be a way to redirect the results to Leo's viewrendered pane.  That would be 
totally cool.

EKR

-- 
You received this message because you are subscribed to the Google Groups 
"leo-editor" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/leo-editor.
For more options, visit https://groups.google.com/d/optout.

Reply via email to