Plotting loop refuses to update display on OS X

I have a Python module that I've written with some pylab plotting routines in it. One of them loops over a list of objects, generating some plots based on the data associated with each list member in turn. It's meant to be an interactive way to step through the list and see what the things look like.

I have the loop set up to wait for user input before going on to the next object, using

x = raw_input("press return for next fit: ")

but for some reason, the plot window never updates. I've tried putting both draw() and show() immediately
before the raw_input() line, and neither works. The plot only seems to update when I ctrl-C out of the loop, and otherwise, I just get the spinning beachball when I mouseover the plot.

I'm using Matplotlib 0.98.3 on OS X (10.5.5) with the built-in python from Apple I think (2.5.1). I'm calling the plotting routine from ipython 0.8.3 using the -pylab option.

The same script previously worked fine under Matplotlib 0.98.1

Other plotting routines from the same module seem to work fine - it's only this plot within a loop that's giving me trouble.

Any ideas?

···

--
Zane Selvans
Amateur Earthling
zane@...1923...
303/815-6866
http://zaneselvans.org
PGP Key: 55E0815F

functions like raw_input blok the mianloop of some gui backends (e.g.,
gtk) but work fine with some other backend (although Tk is the only
backend I know of). So my guess is that you used a different backend
with 0.98.1.
I guess you have a few options.

* try different backend (Tk) with 0.98.3
* use ginput
* or try a ginput-like routine that I made sometime ago which works
okay with raw_input.
   http://sourceforge.net/mailarchive/message.php?msg_id=6e8d907b0803101609s7bd8fecaj851a6ecf1ab2a316%40mail.gmail.com

IHTH,

-JJ

···

On Thu, Oct 2, 2008 at 5:18 PM, Zane Selvans <zane@...1923...> wrote:

I have a Python module that I've written with some pylab plotting
routines in it. One of them loops over a list of objects, generating
some plots based on the data associated with each list member in
turn. It's meant to be an interactive way to step through the list
and see what the things look like.

I have the loop set up to wait for user input before going on to the
next object, using

x = raw_input("press return for next fit: ")

but for some reason, the plot window never updates. I've tried
putting both draw() and show() immediately
before the raw_input() line, and neither works. The plot only seems
to update when I ctrl-C out of the loop, and otherwise, I just get the
spinning beachball when I mouseover the plot.

I'm using Matplotlib 0.98.3 on OS X (10.5.5) with the built-in python
from Apple I think (2.5.1). I'm calling the plotting routine from
ipython 0.8.3 using the -pylab option.

The same script previously worked fine under Matplotlib 0.98.1

Other plotting routines from the same module seem to work fine - it's
only this plot within a loop that's giving me trouble.

Any ideas?

--
Zane Selvans
Amateur Earthling
zane@...1923...
303/815-6866
http://zaneselvans.org
PGP Key: 55E0815F

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users