[Matplotlib-users] Preserving figure over closes and reopenings of the window

2014-08-25 Thread Maciej Kurnicki
I'm using matplotlib for drawing lines, points and circles basically. I have 2 problems i can't solve by myself and it's hard to solve them not digging into source i think. First problem: I got an instance of figure class and i want to preserve it during closing and reopening the output window.

Re: [Matplotlib-users] Preserving figure over closes and reopenings of the window

2014-08-25 Thread Benjamin Root
Maciej, When you close a figure, just about everything gets destroyed (this is why you should always savefig() prior to doing a show()). There is a mechanism for "reloading" a plot using python pickles: http://stackoverflow.com/questions/7290370/store-and-reload-matplotlib-pyplot-object As for se

Re: [Matplotlib-users] Preserving figure over closes and reopenings of the window

2014-08-25 Thread Maciej Kurnicki
Ben, The adjusting and aspect solution works just perfect, thanks for your fast answer. Although i still want to ask for another solution for reloading a plot, because i don't like the idea of serialization and writing to disk. From what i've found even if i have a variables handling figure a

Re: [Matplotlib-users] Preserving figure over closes and reopenings of the window

2014-08-25 Thread Benjamin Root
I am glad that solution worked for you. As for an alternative to pickling, no there is no current mechanism to do what you want easily. It is by design to start destroying everything upon close. We get enough complaints about "memory" leaks as it is. What you are asking for is essentially serializa