Skip to content
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

Save plots also in pickle #66

Open
lvermunt opened this issue Jan 29, 2019 · 4 comments
Open

Save plots also in pickle #66

lvermunt opened this issue Jan 29, 2019 · 4 comments
Labels
enhancement New feature or request

Comments

@lvermunt
Copy link
Contributor

Besides saving the plots as png's in the /plots_nevt*/ directory, it would be good to also have the object itself saved. So one doesn't have to rerun for making small changes in the layout, and it is possible to show two differently trained pT bins in one canvas.

Pickle should work right? @ginnocen, what do you think?

Code will become something like this

plotname = folder+'/ROCcurve.png'
plt.savefig(plotname)
plotnamepickle = folder+'/ROCcurve.pickle'
with open(plotnamepickle,'wb') as fid:
    pickle.dump(figure2 ,fid)

And for offline use

import matplotlib.pyplot as plt
import pickle as pl

fig_handle = pl.load(open('ROCcurve.pickle','rb'))
fig_handle.show()

#Get the data, for further operations
x = fig_handle.axes[0].lines[0].get_data()
@lvermunt lvermunt added the enhancement New feature or request label Jan 29, 2019
@ginnocen
Copy link
Contributor

I am ok with it. We would need to modify the code accordingly. @lvermunt let me know if you can take care of it

@benedikt-voelkel
Copy link
Contributor

@lvermunt @ginnocen Can we close that?

@lvermunt
Copy link
Contributor Author

I forgot about this, didn't push it anymore. Still think it is a feature we should include, so let's keep it open for the moment

@ginnocen
Copy link
Contributor

hi @LuukVermunt what is the plan for this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants