Thank you for these precisions.

I think I'm starting to see more clearly what the
interactive/non-interactive modes do with pyplot commands (plot(), draw(),
show(),…), and with draw() methods.

There is only one thing that I'm not sure about: if we look at your script
and leave the ion() were you left it, shouldn't an ax.draw() be called just
before the ion()?  (I indeed understand from your last post that one "should
not rely" on "pyplot.figure()" sending a delayed draw() request to the GUI.)

So, to summarize the whole discussion:

* Interactive mode:

- Graph elements plotted with *pyplot* commands (not Matplotlib object
methods) are displayed without the need to use draw() or show().

- However, plots done through Matplotlib objects (like Axes) are normally
not displayed (even though they may be, with some backends).  The actual
display of such plots is done through their draw() method (or possibly
pyplot.draw()).  This feature might be used for optimization purposes (a
graph can be refreshed on screen once even though multiple updates were
performed on it through Matplotlib object method calls).

- show(), if used, is non-blocking.  It displays everything that was drawn()
(for instance figures that were created in non-interactive mode).  Things
that were not drawn() might be displayed by some backends, but one should
not rely on this.

* Non-interactive mode

- No figure or graph is displayed and/or refreshed automatically.  This is
useful for optimization purposes, when a graph is updated many times before
it reaches its final state (modification of some elements, like changing a
color, etc.).

- show() displays all the drawn() elements and is blocking.  It is possible
to switch temporarily to interactive mode in order to make it non-blocking.

=> Is this correct?  are there other issues that could be important for
students (and myself!) to grasp so that they use Matplotlib as best as
possible?
-- 
View this message in context: 
http://old.nabble.com/Exact-semantics-of-ion%28%29---tp31728909p31748057.html
Sent from the matplotlib - users mailing list archive at Nabble.com.


------------------------------------------------------------------------------
Simplify data backup and recovery for your virtual environment with vRanger. 
Installation's a snap, and flexible recovery options mean your data is safe,
secure and there when you need it. Data protection magic?
Nope - It's vRanger. Get your free trial download today. 
http://p.sf.net/sfu/quest-sfdev2dev
_______________________________________________
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users

Reply via email to