'pause' in order to cycle though a bunch of plots

I use pause in matlab to cycle through an interactive do-loop and view a bunch of plots in interactively…

Don’t bother reproducing it here, but I am just wondering if this is possible in ipython/matplotlib

Many thanks,

Ben Racine

I've had the same problem. You can write a pause function using the
python input() function but it hangs the GIL and as a result your
window becomes unresponsive. If anyone knows a GIL friendly way to
pause i would also be very interested.

···

On Fri, Nov 14, 2008 at 1:12 PM, Benjamin J. Racine <bjracine@...2383...> wrote:

I use pause in matlab to cycle through an interactive do-loop and view a
bunch of plots in interactively...

Don't bother reproducing it here, but I am just wondering if this is
possible in ipython/matplotlib

Many thanks,

Ben Racine
_______________________________________________
IPython-user mailing list
IPython-user@...177...
http://lists.ipython.scipy.org/mailman/listinfo/ipython-user

pylab.waitforbuttonpress will do what you want.

Gaël

···

On Fri, Nov 14, 2008 at 11:12:14AM -0800, Benjamin J. Racine wrote:

   I use pause in matlab to cycle through an interactive do-loop and view a
   bunch of plots in interactively...

   Don't bother reproducing it here, but I am just wondering if this is
   possible in ipython/matplotlib

waitforbuttonpress immediately returns for any keyboard or mouse event
(from the gui canvas).
If you want to examine the plot (pan, zoom, etc) with mouse, a quick
solution would be to use a loop

while not waitforbuttonpress():
    pass

The loop stops only for a key press.
Also, take a look at ginput().

-JJ

···

On Fri, Nov 14, 2008 at 5:20 PM, Gael Varoquaux <gael.varoquaux@...1818...> wrote:

On Fri, Nov 14, 2008 at 11:12:14AM -0800, Benjamin J. Racine wrote:

   I use pause in matlab to cycle through an interactive do-loop and view a
   bunch of plots in interactively...

   Don't bother reproducing it here, but I am just wondering if this is
   possible in ipython/matplotlib

pylab.waitforbuttonpress will do what you want.

Gaël