Thank you for your response.
Benjamin Root-2 wrote: > > On Sunday, May 29, 2011, Eric O LEBIGOT (EOL) > <eric.lebi...@normalesup.org> wrote: >> >> What does ion() exactly do? >>$$$ >> from matplotlib import pyplot as pp >> >> pp.plot([10, 20, 50]) >> pp.draw() >> >> raw_input('Press enter...') # No graph displayed?!! >>$$$ > > Turning interactive mode on also means an implied "show" command, if > needed. The first program can replace draw() with show(). However, > if interactive mode is off, then the python execution pauses. With it > on, python execution will continue. > So, if anything is drawn when interactive mode is off, does one *have* to use show() at the end? in other words does using a single raw_input() at the end of the program force the use of the interactive mode for *all* figures? (Closing all the figures with a simple "enter" is very convenient, but having a performance penalty for this would not be so nice…). Now, if I understand you correctly, I have another question. I don't understand anymore what draw() does: in fact, it is not necessary in interactive mode, and it does not appear to do anything in non-interactive mode, since show() is really the function that really displays the figures. So, why does matplotlib offer draw()? what does it really do? EOL PS: Here is an example: the following code does *not* display the first figure (Matplotlib 1.0.0 on Mac OS X with the GTKAgg backend): $$$ from matplotlib import pyplot as pp pp.figure() pp.plot([10, 20, 50]) pp.draw() # Will not be displayed despite the draw() pp.ion() # Interactive mode on pp.figure() pp.plot([100, 20, 10]) raw_input('Press enter...') # Only the second graph is displayed $$$ -- View this message in context: http://old.nabble.com/Exact-semantics-of-ion%28%29---tp31728909p31731176.html Sent from the matplotlib - users mailing list archive at Nabble.com. ------------------------------------------------------------------------------ vRanger cuts backup time in half-while increasing security. With the market-leading solution for virtual backup and recovery, you get blazing-fast, flexible, and affordable data protection. Download your free trial now. http://p.sf.net/sfu/quest-d2dcopy1 _______________________________________________ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users