IDLE, matplotlib and show command

I've searched a bit in the FAQ, since in the last days I'm struggling with the show and close command.
I've got a function that calculate values to plot. I calculate plot, use show command and everything goes fine.
I close the figure recalculate values and then replot and everything freezes because the show command seems still active.
I've tried to start IDLE using -n option but no solution. the plots freezes and I loose all calculations, and then I have to restart. reload etc..
I tried also to turn interactive off but no way of solving.

I'm using WIN XP
python 2.5
numpy 1.01
scipy 0.52
matplotlib 0.87.7

and I don't want to come back to matlab :slight_smile: Since in matlab it's very common to calculate something, recalculate, plot etc. etc.

Any help would be very appreciated.
If needed I can post function and file I'm using in .tar
Giorgio

Try setting interactive : True in your matplotlibrc file, and restart your
idle -n session. Then you shouldn't even need to use the show() command, the
behavior will be very similar to matlab.

Darren

···

On Thursday 21 December 2006 5:04 am, Giorgio Luciano wrote:

I've searched a bit in the FAQ, since in the last days I'm struggling
with the show and close command.
I've got a function that calculate values to plot. I calculate plot, use
show command and everything goes fine.
I close the figure recalculate values and then replot and everything
freezes because the show command seems still active.
I've tried to start IDLE using -n option but no solution. the plots
freezes and I loose all calculations, and then I have to restart. reload
etc..
I tried also to turn interactive off but no way of solving.

I'm using WIN XP
python 2.5
numpy 1.01
scipy 0.52
matplotlib 0.87.7

and I don't want to come back to matlab :slight_smile: Since in matlab it's very
common to calculate something, recalculate, plot etc. etc.

I've created a shortcut in the desktop to start idle-n
unsing C:\Python25\Lib\idlelib\idle.bat -n
then I changed matplotlibrc and set interactive: True
then started Idle, loaded the module and run.
At first I had this error message...

Traceback (most recent call last):
  File "C:\Python25\Lib\site-packages\prove\demo.py", line 1, in <module>
    from pylab import *
  File "C:\Python25\lib\site-packages\pylab.py", line 1, in <module>
    from matplotlib.pylab import *
  File "C:\Python25\lib\site-packages\matplotlib\pylab.py", line 220, in <module>
    new_figure_manager, draw_if_interactive, show = pylab_setup()
  File "C:\Python25\lib\site-packages\matplotlib\backends\__init__.py", line 23, in pylab_setup
    globals(),locals(),[backend_name])
  File "C:\Python25\lib\site-packages\matplotlib\backends\backend_wxagg.py", line 19, in <module>
    import wx
ImportError: No module named wx

naturally I installed WX wxPython2.8-win32-unicode-2.8.0.1-py25

and restart the demo. plots load faster (and I needed to use show). but then I recalculated and restart and everything crashed again :frowning:
I'm frustrated .. any hints :frowning:
And sorry for bother I dont' want to get back to matlab
Giorgio

It worked !!!!
I dont' know why , probably i dind't restart correctly after changing config but with the setting you suggest it went fine.
THANKS !! You SAVED my DAY !!
Giorgio

I see. When you use idle, you should set backend : TkAgg in your rc settings.
The reason for this is discussed in the matplotlib users manual, see
http://matplotlib.sourceforge.net/users_guide_0.87.7.pdf.

Darren

···

On Thursday 21 December 2006 08:16, Giorgio Luciano wrote:

I've created a shortcut in the desktop to start idle-n
unsing C:\Python25\Lib\idlelib\idle.bat -n
then I changed matplotlibrc and set interactive: True
then started Idle, loaded the module and run.
At first I had this error message...

Traceback (most recent call last):
File "C:\Python25\Lib\site-packages\prove\demo.py", line 1, in <module>
from pylab import *
File "C:\Python25\lib\site-packages\pylab.py", line 1, in <module>
from matplotlib.pylab import *
File "C:\Python25\lib\site-packages\matplotlib\pylab.py", line 220, in
<module>
new_figure_manager, draw_if_interactive, show = pylab_setup()
File "C:\Python25\lib\site-packages\matplotlib\backends\__init__.py",
line 23, in pylab_setup
globals(),locals(),[backend_name])
File
"C:\Python25\lib\site-packages\matplotlib\backends\backend_wxagg.py",
line 19, in <module>
import wx
ImportError: No module named wx

naturally I installed WX wxPython2.8-win32-unicode-2.8.0.1-py25

and restart the demo. plots load faster (and I needed to use show). but
then I recalculated and restart and everything crashed again :frowning:
I'm frustrated .. any hints :frowning:
And sorry for bother I dont' want to get back to matlab

I've seen that it also works with
WxAgg version 2.8.0.1 for python 2.5
I hope this information can be useful
Giorgio