On Sunday, May 29, 2011, Eric O LEBIGOT (EOL) <eric.lebi...@normalesup.org> wrote: > > What does ion() exactly do? From reading the documentation, I gather that > the interactive mode is equivalent to issuing an automatic draw() after each > plotting comment. However, a program like the following one does not draw > anything (Matplotlib 1.0, both on Mac OS X and Windows): > >>>> > from matplotlib import pyplot as pp > > pp.plot([10, 20, 50]) > pp.draw() > > raw_input('Press enter...') # No graph displayed?!! > <<< > > However, adding ion() and removing the draw() displays the graph. So, it > looks like the interactive mode does more than what I gather from the docs. > What does ion() do in addition to adding an automatic draw()? Can the above > program be modified so as to draw the graph but without using ion()? > > Any input would be much appreciated! > > EOL > > PS: the documentation I was referring to reads: "The interactive property of > the pyplot interface controls whether a figure canvas is drawn on every > pyplot command. If interactive is False, then the figure state is updated on > every plot command, but will only be drawn on explicit calls to draw(). When > interactive is True, then every pyplot command triggers a draw."
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. Note, there are some issues with the macosx backend (and it still exists) with respect to interactive mode. When on your Mac, you can use one of the other backends for intended behavior. Also, there were a number of additional bug fixes with the backends between 1.0.0 and 1.0.1. I hope this clears things up, Ben Root > -- > View this message in context: > http://old.nabble.com/Exact-semantics-of-ion%28%29---tp31728909p31728909.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 > ------------------------------------------------------------------------------ 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