I've got a question about Pylab. I'm able to plot a graph, but once the graph shows up, I no longer am able to run anything else in Idle. So if I want to run a graph in idle, I'm stuck at it, even after I close the graph window, and the only way I can control Idle again is to do a keyboard interrupt. Is this normal? Is it possible I have a weird version of pylab installed somehow?
It might have something to do with matplotlib's 'interactive' configuration parameter. Try this in Idle - http://ideone.com/2CN2x if yours is True set it to False - http://ideone.com/QKzuF then try a simple plot - http://ideone.com/qUXRk control doesn't return to the shell till you close the plot window. I'm using python 2.7 if that worked look at these links http://matplotlib.sourceforge.net/faq/installing_faq.html#matplotlib-compiled-fine-but-nothing-shows-up-with-plot http://matplotlib.sourceforge.net/users/customizing.html#customizing-matplotlib i just tried ipython it is matplotlib friendly and you can interact with the plot figure - pretty cool - you can add lines and 'elements' one at a time and then see it immediately. i have had it installed for a long time and never tried it.
Thanks for the reply. My problem is not that plots aren't showing, my problem is that once the plot shows up, I don't regain control Idle after I close the plot. If I set the 'interactive' control parameter to True (it was False by default), passing in a plot function causes a plot window to open immediately, with me being able to control Idle. But with 'show()', I still don't get control back after I close the window.
Hmm, I haven't played with Pylab yet. I assume that you checked the user guide on the Pylab site: http://matplotlib.sourceforge.net/contents.html
maybe you have to close the plot and use pylab.close() which version of Python/Idle ??
Do you just add python.close to the end of the program? I'm using python and IDLE version 2.6.6. I'll take a look at that guide.
hi tombedor. i am having the same issues with pylab.show() as well. my python is installed on a mac via fink. this causes python to be installed not where osx usually expects it, i guess, and this gives some issues with the backend. (again: this is a guess). could this be your case as well?
i use the close method in the script after the show method
Join our real-time social learning platform and learn together with your friends!