Exact semantics of Matplotlib’s “interactive mode” (ion(), ioff())?

Here is the summary of an interesting discussion on this subject in the Matplotlib mailing list. The executive summary is:

  • The interactive mode (activated with ion()) automates many things. In particular, pyplot.* commands automatically update on the screen the relevant axes. However, method calls on Matplotlib objects like ax.plot() (ax being an Axes object) do not normally perform automatic updates; in this case, pyplot.draw() performs the necessary update.)

  • The non-interactive mode is less convenient. draw() does not normally update the figure on screen. The fact that draw() is somewhat “inactive” in non-interactive mode is not mentioned in the current documentation, but will hopefully be included there soon.

In the mean time, more information on the interactive and non-interactive modes can be found in a current branch of Matplotlib. A better documentation for draw(), show() and friends can also be found in the same branch.

Leave a Comment