MPlot lib questions

Hi,
I really like the MPlot and matplotlib libraries, but am have some issues using
it in an interactive manner.

Here are the details:
- Running on Windows XP
- Run through an ipython interactive session
- Run *during data-taking*, that is, every 3s or so, several calls to oplot
  are made.
- Ipython is run with the -wthread option, and thus threading.enumerate() shows
  two threads: [<_MainThread(MainThread, started)>,
                <IPShellWX(Thread-1, started)>]
- pylab.ion() has been called

The problem is that the window refuses to refresh itself until the entire
data taking process is finished (~8 hours)

If I try and simulate the above problems manually, one easy way to create
this unresponsiveness of the MPlot window is to call time.sleep(10) from
IPython. The window will remain unresponsive for 10s.

Why is this? Shouldn't the plot-refresh code, or at the very least, the gui
code be running in the wxpython thread?

I've had this problem in the past, and sent around some emails. At the time
a managed to "solve" the problem, but there were so many variables (ipython
command line args, threads present, ways in which functions were called, etc)
that I was unable to isolate the solution. I'm facing the same problem again,
and tried to recreate the solution, but it's not working. I guess there's some
black magic involved somewhere.

The problem is also that I'm a struggling PhD student (ie in over my head),
so I didn't really have time to figure this one out. I'd love to be more of
a contributor to matplotlib and it's related projects, but at the moment I don't
really have time to reinvent the wheel everytime I do an experiment.
Everyone here uses labview (which drives me nuts).

Any help you could give me would be *greatly* appreciated.

Marc

Hi Marc,

I'm not very familiar with IPython (probably to my detriment), but I
believe this may
be an inherent problem with wx v. command-line program, and have
little to do with
MPlot, matplotlib, or IPython. That is, I think that
wxWidgets/wxPython's MainLoop()
is never really going to interact well with a command-line
application. I'd be happy
to be proven wrong -- I've hit this problem myself and been unable to
reliably solve it.
Anyway, can you send a simple example that demonstrates non-responsiveness?

I think it would be easy to write a wxPython App (even with
PythonCard) that provided
a command-line which was passed off to IPython (say, on an Enter
event). I'd be much
more confident that you could get the wx widgets to respond, and
still have a working
command-line. I don't know whether this is compatible with the "IPython way".

Cheers,

--Matt Newville

Matt Newville wrote:

I think it would be easy to write a wxPython App (even with
PythonCard) that provided
a command-line which was passed off to IPython (say, on an Enter
event).

PyShell is good option, if you can get ipython to work with it.

-Chris

···

--
Christopher Barker, Ph.D.
Oceanographer
                                         
NOAA/OR&R/HAZMAT (206) 526-6959 voice
7600 Sand Point Way NE (206) 526-6329 fax
Seattle, WA 98115 (206) 526-6317 main reception

Chris.Barker@...259...

Christopher Barker wrote:

PyShell is good option, if you can get ipython to work with it.

oops, I meant PyCrust. Sorry.

-Chris

···

--
Christopher Barker, Ph.D.
Oceanographer
                                         
NOAA/OR&R/HAZMAT (206) 526-6959 voice
7600 Sand Point Way NE (206) 526-6329 fax
Seattle, WA 98115 (206) 526-6317 main reception

Chris.Barker@...259...