xplt to matplotlib

Hi,

I need help for the conversion from scipy.xplt to matplotlib:

We have several cases where one plot is shown after another,
separated via
  raw_input("press <enter> for the next plot")

However, while waiting for <enter> the redraw of the plot window
does not work (e.g if it gets behind some other window).

This example, run as a script, demonstrates the problem:

···

#---------------------------------------------------------
from pylab import *
ion() # interactive mode
x = arange(10)
plot(x,x*x) # add something to the plot
draw()
raw_input("press <enter> for the next plot")
clf() # another plot
plot(x,x**3)
draw()
raw_input("press <enter> for end")
#---------------------------------------------------------

This does work for TkAgg but not for GTK, GTKAgg and WX.

Best, Arnd

P.S.: This is under debian linux with the latest CVS.
      I could not test it under WXAgg because this gives me
      (process:4035): GLib-GObject-CRITICAL **: g_object_new: assertion
      `G_TYPE_IS_OBJECT (object_type)' failed

This is a threading problem. As I understand it, you have two options:
1. Stick with TkAgg.
2. Run the demo under iPython.

Otherwise the user has to close the plot window to keep the thread going.

···

On 1/25/06, Arnd Baecker <arnd.baecker@...273...> wrote:

Hi,

I need help for the conversion from scipy.xplt to matplotlib:

We have several cases where one plot is shown after another,
separated via
  raw_input("press <enter> for the next plot")

However, while waiting for <enter> the redraw of the plot window
does not work (e.g if it gets behind some other window).

This example, run as a script, demonstrates the problem:

#---------------------------------------------------------
from pylab import *
ion() # interactive mode
x = arange(10)
plot(x,x*x) # add something to the plot
draw()
raw_input("press <enter> for the next plot")
clf() # another plot
plot(x,x**3)
draw()
raw_input("press <enter> for end")
#---------------------------------------------------------

This does work for TkAgg but not for GTK, GTKAgg and WX.

Best, Arnd

P.S.: This is under debian linux with the latest CVS.
      I could not test it under WXAgg because this gives me
      (process:4035): GLib-GObject-CRITICAL **: g_object_new: assertion
      `G_TYPE_IS_OBJECT (object_type)' failed

-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems? Stop! Download the new AJAX search engine that makes
searching your log files as easy as surfing the web. DOWNLOAD SPLUNK!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=103432&bid=230486&dat=121642
_______________________________________________
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users

Hi Ryan,

This is a threading problem. As I understand it, you have two options:
1. Stick with TkAgg.

Hmm. Unfortunately, TkAgg is a factor 2 slower for animations
than GTKAgg.

2. Run the demo under iPython.

I just tried that, i.e. via:
  ipython -pylab
  run tst.py
but it did not work: whenever the plot window is behind
some other window during the raw_input(""),
the contents is destroyed.

Best, Arnd

···

On Wed, 25 Jan 2006, Ryan Krauss wrote:

Hi,

to add one more piece of information to this:

This is a threading problem. As I understand it, you have two options:
1. Stick with TkAgg.

I just re-installed an old matplotlib.__version__: '0.82'.
Here GTKAgg works fine with redrawing for the example below!
So this looks to me more like some double buffering issue?

Remarks:
- GTK: here only the graph axes are redrawn, but not the plot curve itself
  (wrong bitmap in double buffer?)
- WXAgg: the redraw also does not work (ie the same as with a recent MPL).
- with TkAgg even zooming works
  (I think this is because of the
   different way the main-loop works for Tk ....)

I don't understand the details of MPL well enough,
but if it used to work with GTKAgg at some point, it would be
great if it could be made working again...

Best,

Arnd

···

On Wed, 25 Jan 2006, Ryan Krauss wrote:

2. Run the demo under iPython.

Otherwise the user has to close the plot window to keep the thread going.

On 1/25/06, Arnd Baecker <arnd.baecker@...273...> wrote:
> Hi,
>
> I need help for the conversion from scipy.xplt to matplotlib:
>
> We have several cases where one plot is shown after another,
> separated via
> raw_input("press <enter> for the next plot")
>
> However, while waiting for <enter> the redraw of the plot window
> does not work (e.g if it gets behind some other window).
>
> This example, run as a script, demonstrates the problem:
>
> #---------------------------------------------------------
> from pylab import *
> ion() # interactive mode
> x = arange(10)
> plot(x,x*x) # add something to the plot
> draw()
> raw_input("press <enter> for the next plot")
> clf() # another plot
> plot(x,x**3)
> draw()
> raw_input("press <enter> for end")
> #---------------------------------------------------------
>
> This does work for TkAgg but not for GTK, GTKAgg and WX.
>
> Best, Arnd