pylustrator
pylustrator copied to clipboard
Feature request: loading and editing pickle-dumped figures
First of all, awesome work! Thank you.
Matplotlib folks suggest saving figure objects as a pickle for later modification.
import matplotlib.pyplot as plt
import pickle
# plot a fancy figure
# ...
fig = plt.gcf()
pickle.dump(fig, open('figObj.pickle', 'wb')) # for future
I was thinking it would be truly amazing if pylustrator could pick up the editing job from those saved picked. Something like this:
import matplotlib.pyplot as plt
import pylustrator
pylustrator.start()
pylustrator.pickle_load('figObj.pickle') # interactive editing
Looking forward to the future of pylustrator! Arash
I am not sure if i want to recommend people using pickel files as they are not intended for long term storage as the serialisation can change between python versions. But I can have a look if it is possible to implemented such a feature for pylustrator. And yes in general it would be great to have a good format to save matplotlib figures.
With this commit you should be able to start pylustrator after figure generation. Which means you should be able to load your figure from pickle first and then start pylustrator. You can install the repository version with
pip install git+https://github.com/rgerum/pylustrator