-
-
Notifications
You must be signed in to change notification settings - Fork 7.9k
Cannot properly reload figure that was previously pickled #3483
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
The bug occurs when the pickle is loaded with mpl in interactive mode, and not otherwise, at least in my limited testing. I think the problem is that in interactive mode, If not, then maybe we need to have a @mdepitta in the meantime, a workaround for you is manually turn interactive mode off ( |
Or, instead of a wrapper around pickle.load(), how about a context manager? On Sun, Sep 7, 2014 at 4:06 PM, Eric Firing notifications@github.com
|
@WeatherGod Yes, a context manager would work. A disadvantage is that context managers are relatively new features of Python, and not something a beginner or casual user (or perhaps an old-timer like myself) is likely to have at their fingertips. With a pair of wrappers we could provide a simple function interface with memorable names (really, if you were a beginner, would you think of using the term "pickle" for saving a plot?), and with the ability to improve functionality via metadata and error handling. In fact, we could add the pickling capability to the |
I would advocate against pushing the use of pickle to store/share plots due to the security issues associated with them. This will hopefully be addressed by the effort to serialize figures to json. |
Wow, I'm so behind on my notifications! Thanks for raising this @mdepitta. Can you provide a SSCCE (Short, Self Contained, Correct , Example) to allow us to reproduce? This will dramatically speed up the development of a fix for this issue. Thanks! |
Given the "won't fix" decision, I'm going to close this. |
Dear all,
I just figure out that matplotlib does not have apparently a simple way to save interactive plots as MATLAB "fig" figures. I sincerely hope the "experimental" pickling will be soon consolidated because it would be of great benefit for users imho.
Briefly, I followed the simple procedure outlined here in order to pickle and reload figures:
http://stackoverflow.com/questions/7290370/store-and-reload-matplotlib-pyplot-object
It seems that I am able to pickle the figure indeed, but not to reload it properly.
This is what I get:
Any suggestion? Shall I bother about this?
I am using matplotlib 1.3.1 on Fedora 20 with QtAgg backend.
Thanks for your time,
Maurizio
The text was updated successfully, but these errors were encountered: