figure: underlying C/C++ object has been deleted

Hi,

I forgot to write something in my last email: I just wish to thank the developers of this insanely

great tool. Long live open source. Thank you very much for this, it’s the best data/graph manipulation

software ever.

Now, for my question: I’m not sure if I misunderstood something, or is it a bug of some sort.

Here is the code with the error:

http://pastebin.com/3QUws70n

I don’t understand, why would a figure object get deleted after it’s shown on the screen? What am I doing wrong?

Thanks in advance,

Tomislav

tomislav_maric@...2537... wrote:
[...]

Here is the code with the error:

matplotlib figure gets deleted - Pastebin.com

I don't understand, why would a figure object get deleted after it's shown on the screen? What am I doing wrong?

This is a common "gotcha": don't use pyplot.show() anywhere other than at the end of a script, and then only when you want the script to display a figure and block. For working interactively with ipython (which it appears you are doing, and which is recommended), use "ipython -pylab". Then, the figure will be redrawn automatically after pyplot functions are called. If you use a more OO approach, say using the Axes.plot(...) method rather than the pyplot.plot(...) function, you can use pyplot.draw() to force an update when you want one.

Eric

···

Thanks in advance,

Tomislav