Vote count:
0
I need to use interactive mode when plotting with matplotlib (it should be a script, not python or ipython console). But setting plt.ion()
causes a strange bug (?). When I try to plot my figure (I don't think it really matters, what I do exactly, because in non-interactive mode it works perfectly fine) I don't see it - I get a blank grey window for split-second, which momentarily disappears and the programme exits. If I explicitly add plt.draw()
(and plt.pause(1)
to see the result), I see that the figure appears as expected. If I do the same after modifications I want to do to the figure when it is visible, the figure changes. But the window still disappears after the pause is over.
I run it in Spyder with Qt4Agg as a backend under Ubuntu. Tried running the script from terminal as python my_script.py
, the result is identical.
What could be the problem? How do I stop the figure from disappearing when in interactive mode?
Aucun commentaire:
Enregistrer un commentaire