I know we should all do 100% reproducible data analysis and save all our data before plotting them, but unfortunately often the overheads of doing that are still too large. So I wanted to automate saving data used to generate a figure side-by-side with the figure itself.
I’ve made a little proof of concept of this which wraps pyplot functions keeping track of data being plotted, and when savefig() is called stores the data next to the figure, and also produces a short python script that replots the figure from the data.
The POC is available at
Its fairly straightforward piece of code but works fine with basic plot, scatter and hist commands.
Any feedback very much appreciated and if anybody would like to contribute toward completing the functionality that would be very welcome. And of course even better if eventually this is worth integrating into matplotlib itself.