Figure save hack

Hey,

last weekend I wrote a hook which can track figure creation. Basically
it takes care of creating the new figure and wraps it to track all
changes to it. Its a hack, and the code is not cleaned up or tested
much, but I like to do scripts that I run with many parameters to create
plots and it works well to allow me to open the figures in a way that I
can zoom, etc. and would allow editing (a bit) later on too. So while I
doubt the approach can be made something serious, and there are probably
things that don't work (right now 3D Axis can be done with a bit extra
but mouse zooming does not work inside a 3D Axis, though I think its
likely not difficult to change), I thought I would put it online because
I am not aware of any way to save matplotlib figures:

https://github.com/seberg/haunter-for-matplotlib-figures

Maybe someone finds it useful or interesting :slight_smile:

Regards,

Sebastian Berg

Hi,

This sounds actually very interesting. I have been thinking about how to save matplotlib figures in a way comparable to the Matlab .fig format: a file that holds the data (for instance using HDF5/pytables, some figures might hold a lot of data) and the plotting commands to exactly reconstruct the figure. However, I never got around of thinking about an actual implementation for Matplotlib. Hopefully your work can inspire me to actually get it started , and I will try to find some time to dig in your code the coming weeks.

At the Spyder mailing list the idea of saving figures a la Matlab briefly popped before as well: http://groups.google.com/group/spyderlib/browse_thread/thread/bf582bac96ff875/d5e94fe9296afbe5

I think saving figures in this manner would be a nice feature for matplotlib.

Thanks for sharing this!

Regards,
David

PS: sorry to Sebastian for sending the message twice

···

On 15/03/12 11:22, Sebastian Berg wrote:

Hey,

last weekend I wrote a hook which can track figure creation. Basically
it takes care of creating the new figure and wraps it to track all
changes to it. Its a hack, and the code is not cleaned up or tested
much, but I like to do scripts that I run with many parameters to create
plots and it works well to allow me to open the figures in a way that I
can zoom, etc. and would allow editing (a bit) later on too. So while I
doubt the approach can be made something serious, and there are probably
things that don't work (right now 3D Axis can be done with a bit extra
but mouse zooming does not work inside a 3D Axis, though I think its
likely not difficult to change), I thought I would put it online because
I am not aware of any way to save matplotlib figures:

https://github.com/seberg/haunter-for-matplotlib-figures

Maybe someone finds it useful or interesting :slight_smile:

Regards,

Sebastian Berg

------------------------------------------------------------------------------
This SF email is sponsosred by:
Try Windows Azure free for 90 days Click Here
http://p.sf.net/sfu/sfd2d-msazure
_______________________________________________
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users

Indeed, saving figures in the manner of Matlab would be a great feature enhancement for Matplotlib.
Keep Hacking ! :slight_smile:

Cheers
François

Hi,

I have been dreaming about this for a long time too,

This would really be a nice feature. I often need to come back to the formatting of a plot, and its formatting only, without the need to really access the data (which I often end up calculating again!)

Guillaume

···

Le 16/03/2012 09:17, David Verelst a écrit :

Hi,

This sounds actually very interesting. I have been thinking about how to
save matplotlib figures in a way comparable to the Matlab .fig format: a
file that holds the data (for instance using HDF5/pytables, some figures
might hold a lot of data) and the plotting commands to exactly
reconstruct the figure. However, I never got around of thinking about an
actual implementation for Matplotlib. Hopefully your work can inspire me
to actually get it started , and I will try to find some time to dig in
your code the coming weeks.

At the Spyder mailing list the idea of saving figures a la Matlab
briefly popped before as well:
http://groups.google.com/group/spyderlib/browse_thread/thread/bf582bac96ff875/d5e94fe9296afbe5

I think saving figures in this manner would be a nice feature for
matplotlib.

Thanks for sharing this!

Regards,
David

PS: sorry to Sebastian for sending the message twice

On 15/03/12 11:22, Sebastian Berg wrote:

Hey,

last weekend I wrote a hook which can track figure creation. Basically
it takes care of creating the new figure and wraps it to track all
changes to it. Its a hack, and the code is not cleaned up or tested
much, but I like to do scripts that I run with many parameters to create
plots and it works well to allow me to open the figures in a way that I
can zoom, etc. and would allow editing (a bit) later on too. So while I
doubt the approach can be made something serious, and there are probably
things that don't work (right now 3D Axis can be done with a bit extra
but mouse zooming does not work inside a 3D Axis, though I think its
likely not difficult to change), I thought I would put it online because
I am not aware of any way to save matplotlib figures:

https://github.com/seberg/haunter-for-matplotlib-figures

Maybe someone finds it useful or interesting :slight_smile:

Regards,

Sebastian Berg

------------------------------------------------------------------------------
This SF email is sponsosred by:
Try Windows Azure free for 90 days Click Here
http://p.sf.net/sfu/sfd2d-msazure
_______________________________________________
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users

------------------------------------------------------------------------------
This SF email is sponsosred by:
Try Windows Azure free for 90 days Click Here
http://p.sf.net/sfu/sfd2d-msazure
_______________________________________________
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users