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()
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
And for offline use