Exact semantics of Matplotlib's "interactive mode" (ion(), ioff())?
Exact semantics of Matplotlib's "interactive mode" (ion(), ioff())?
--
Become part of the top 3% of the developers by applying to Toptal
https://topt.al/25cXVn
--
Music by Eric Matyas
https://www.soundimage.org
Track title: Puzzle Game 2 Looping
--
Chapters
00:00 Question
02:10 Accepted answer (Score 16)
03:28 Answer 2 (Score 4)
04:12 Thank you
--
Full question
https://stackoverflow.com/questions/6130...
Accepted answer links:
[interesting discussion]: https://www.mail-archive.com/matplotlib-...
[a current branch]: https://matplotlib.org/tutorials/introdu...
[documentation]: https://github.com/efiring/matplotlib/co...
--
Content licensed under CC BY-SA
https://meta.stackexchange.com/help/lice...
--
Tags
#python #matplotlib #interactivemode
#avk47
ACCEPTED ANSWER
Score 16
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 likeax.plot()(axbeing 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 thatdraw()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.
ANSWER 2
Score 4
I would suggest that you follow the last comment of 'Thomas K'. I remember a similar question on the mailing list, but I couldn't find it after several minutes of searching. Sorry.
I had also this problem and the better easier way for me was/is to use ipython --pylab. I have a much older version of matplotlib installed which have some problems with ion(). Beside this, matplotlib had also some problems with draw() on Windows. Maybe it was fixed in the last versions.
p.s.: Sorry that I couldn't helped you really well.
Best regards.