Matplotlib conflicts with IDLE

I can't get Matplotlib to work with IDLE. plt.show() makes beutiful plots,
but IDLE is hung. Entering "exit" in the little pop-up console window
raises an exception in IDLE, and then leaves the plot window hung. It looks
like the old "dualing event loops" problem with IDLE, although the
Matplotlib docs don't use that phrase.

The way I ususally solve this is to use IDLE for editing my scripts, and a
separate shell to actually run them. Here, I'm not using a saved script.
This needs to work interactively, for students using Python in a physics
class. I see that little console window, and it sure looks like that was
intended to do what I need, but I can't find any documentation on the
commands. How do I switch back and forth between IDLE and the plot window
without leaving some process in limbo? Even better, is there an option to
have the event loop automatically switch back to IDLE after each update?

I'm running on Mac OS-X, so it looks like IPython is not an option. Also, I
would rather stick with IDLE. It is the perfect IDE for non-CS students who
shouldn't be spending their time on the complexities of a plotting package.

···

--
View this message in context: http://old.nabble.com/Matplotlib-conflicts-with-IDLE-tp27473693p27473693.html
Sent from the matplotlib - users mailing list archive at Nabble.com.

David MacQuigg wrote:

I can't get Matplotlib to work with IDLE.

Sorry, I don't know anything about IDLE, but...

I'm running on Mac OS-X, so it looks like IPython is not an option.

Why not? I use Ipython on OS-X all the time, and it is fabulous, really fabulous.

Also, I
would rather stick with IDLE. It is the perfect IDE for non-CS students who
shouldn't be spending their time on the complexities of a plotting package.

Spyder:

http://packages.python.org/spyder/

Looks really promising, but I don't think they've got OS-X packages yet.

-Chris

···

--
Christopher Barker, Ph.D.
Oceanographer

Emergency Response Division
NOAA/NOS/OR&R (206) 526-6959 voice
7600 Sand Point Way NE (206) 526-6329 fax
Seattle, WA 98115 (206) 526-6317 main reception

Chris.Barker@...259...

This is not a matplotlib problem but an issue with Python itself. Unlike for example Tcl/Tk, Python does not have support for event loops. Each of the graphics backends (Tkinter, PyGTK, PyQT, the Mac OS X native backend) therefore each implement an event loop on their own. In general, these will clash with each other. Even IDLE's event loop (IDLE uses Tkinter) does not play nice with Tkinter itself: import Tkinter; Tkinter.Tk() opens a Tk window when run from the console, but does nothing when run from IDLE. Until Python itself supports event loops, I doubt that these problems will go away. I believe that ipython has made some progress in addressing these issues, but that of course won't help people who use regular python instead of ipython.

--Michiel.

···

--- On Fri, 2/5/10, David MacQuigg <macquigg@...2959...> wrote:

From: David MacQuigg <macquigg@...2959...>
Subject: [Matplotlib-users] Matplotlib conflicts with IDLE
To: matplotlib-users@lists.sourceforge.net
Date: Friday, February 5, 2010, 3:46 PM

I can't get Matplotlib to work with IDLE. plt.show()
makes beutiful plots,
but IDLE is hung. Entering "exit" in the little
pop-up console window
raises an exception in IDLE, and then leaves the plot
window hung. It looks
like the old "dualing event loops" problem with IDLE,
although the
Matplotlib docs don't use that phrase.

The way I ususally solve this is to use IDLE for editing my
scripts, and a
separate shell to actually run them. Here, I'm not
using a saved script.
This needs to work interactively, for students using Python
in a physics
class. I see that little console window, and it sure
looks like that was
intended to do what I need, but I can't find any
documentation on the
commands. How do I switch back and forth between IDLE
and the plot window
without leaving some process in limbo? Even better,
is there an option to
have the event loop automatically switch back to IDLE after
each update?

I'm running on Mac OS-X, so it looks like IPython is not an
option. Also, I
would rather stick with IDLE. It is the perfect IDE
for non-CS students who
shouldn't be spending their time on the complexities of a
plotting package.

--
View this message in context: http://old.nabble.com/Matplotlib-conflicts-with-IDLE-tp27473693p27473693.html
Sent from the matplotlib - users mailing list archive at
Nabble.com.

------------------------------------------------------------------------------
The Planet: dedicated and managed hosting, cloud storage,
colocation
Stay online with enterprise data centers and the best
network in the business
Choose flexible plans and management services without
long-term contracts
Personal 24x7 support from experience hosting pros just a
phone call away.
http://p.sf.net/sfu/theplanet-com
_______________________________________________
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
matplotlib-users List Signup and Options

I can't get Matplotlib to work with IDLE. plt.show() makes beutiful plots,
but IDLE is hung. Entering "exit" in the little pop-up console window
raises an exception in IDLE, and then leaves the plot window hung. It looks
like the old "dualing event loops" problem with IDLE, although the
Matplotlib docs don't use that phrase.

The way I ususally solve this is to use IDLE for editing my scripts, and a
separate shell to actually run them. Here, I'm not using a saved script.
This needs to work interactively, for students using Python in a physics
class. I see that little console window, and it sure looks like that was
intended to do what I need, but I can't find any documentation on the
commands. How do I switch back and forth between IDLE and the plot window
without leaving some process in limbo? Even better, is there an option to
have the event loop automatically switch back to IDLE after each update?

I'm running on Mac OS-X, so it looks like IPython is not an option. Also, I
would rather stick with IDLE. It is the perfect IDE for non-CS students who
shouldn't be spending their time on the complexities of a plotting package.

There's a different version of Idle called VIdle that is supposed to
fix certain problems. I haven't a clue if yours is one of them, but
you might try it. It comes standard in VPython http://www.vpython.org
... I don't know if it's available separately.

···

On Fri, Feb 5, 2010 at 3:46 PM, David MacQuigg <macquigg@...2959...> wrote:

--
View this message in context: http://old.nabble.com/Matplotlib-conflicts-with-IDLE-tp27473693p27473693.html
Sent from the matplotlib - users mailing list archive at Nabble.com.

------------------------------------------------------------------------------
The Planet: dedicated and managed hosting, cloud storage, colocation
Stay online with enterprise data centers and the best network in the business
Choose flexible plans and management services without long-term contracts
Personal 24x7 support from experience hosting pros just a phone call away.
http://p.sf.net/sfu/theplanet-com
_______________________________________________
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
matplotlib-users List Signup and Options

Thanks to all who have replied. {Ipython, Vpython, Spyder, WxPython,
Eclipse} x {Windows XP, Windows 7, Mac OSX, Linux} - looks like we have many
{IDE, platform} combinations to test, and no consensus on any one choice.
Student needs are different than large project developers. I need an IDE
that works well on all these platforms, is easy to install, and easy to use
for physics students who are writing small programs.

Unfortunately, I don't have time for beta testing these products, and I need
to make a recommendation soon. Perhaps we need an enhancement request for
Matplotlib. It needs either IDLE or one of these other IDEs thoroughly
tested and included in the packages for each platform.

One of the teachers in our group is very happy with Sage. It looks like a
good replacement for Matlab. I don't like that it is so different than
standard Python, but there is great appeal to something that "just works".
Students will have even less time than I do to struggle with these setup
issues.

I'm still experimenting with IDLE, and it sure looks like nothing
fundamentally wrong, just a sloppy integration with Matplotlib and
documentation that either doesn't exist, or is too hard to find. For
example, if I use draw() instead of show(), I can avoid freezing the IDLE
window, and make multiple overlaid plots as needed. I can't find any
documentation on this, however, and I am probably doing it wrong.

Is there anyone here that uses IDLE with Matplotlib. Maybe we just need a
HOWTO note. What is the Console window for? What commands are available in
that window? I see that "exit" causes control to switch back to IDLE, but
then I can't continue using draw(). When should I use close() or exit()?
Is there any way to clear the plot window of existing data, and continue
plotting without having to restart the entire session?

···

--
View this message in context: http://old.nabble.com/Matplotlib-conflicts-with-IDLE-tp27473693p27489064.html
Sent from the matplotlib - users mailing list archive at Nabble.com.