Native file format

Hi List,
is there a way to store matplotlib figures in something like a native file format?
I am thinking of something that keeps track of all the objects (patches(?)) in a mpl figure, so that later you could just revisit that figure and change properties.

Or add/remove objects from the canvas.
I didn’t find anything on the website.
Thanks,
Jan

Jan Strube wrote:

Hi List,
is there a way to store matplotlib figures in something like a native file format?
I am thinking of something that keeps track of all the objects (patches(?)) in a mpl figure, so that later you could just revisit that figure and change properties.
Or add/remove objects from the canvas.
I didn't find anything on the website.
Thanks,
    Jan

No, there is no mechanism for doing this, although I think it has been requested before.

Eric

Why can't mpl's figures be pickled?

Best,
Edin

···

On 2/4/07, Eric Firing <efiring@...202...> wrote:

Jan Strube wrote:
> Hi List,
> is there a way to store matplotlib figures in something like a native
> file format?
> I am thinking of something that keeps track of all the objects
> (patches(?)) in a mpl figure, so that later you could just revisit that
> figure and change properties.
> Or add/remove objects from the canvas.
> I didn't find anything on the website.
> Thanks,
> Jan

No, there is no mechanism for doing this, although I think it has been
requested before.

Eric

Sorry, don’t know anything about pickling. Is it device-independent?

If I have a problem, could I pickle the figure, attach it to a bug report?
Can I share the files with colleagues on different architechtures?
If so, it maybe good enough.
But otherwise I was more thinking of something like YAML or so.

Cheers,
Jan

···

On 2/7/07, Edin Salkovic <edin.salkovic@…287…> wrote:

On 2/4/07, Eric Firing <efiring@…202…> wrote:

Jan Strube wrote:

Hi List,
is there a way to store matplotlib figures in something like a native

file format?
I am thinking of something that keeps track of all the objects
(patches(?)) in a mpl figure, so that later you could just revisit that
figure and change properties.

Or add/remove objects from the canvas.
I didn’t find anything on the website.
Thanks,
Jan

No, there is no mechanism for doing this, although I think it has been

requested before.

Eric

Why can’t mpl’s figures be pickled?

Best,
Edin

The main thing is we need to add pickle support for all of mpl's extension code

  http://docs.python.org/lib/node321.html

In earlier attempts people got stuck with trying to pickle the
CXX extension code, which was causing some problems, but these
problems may be fixed in more recent versions of CXX. Todd Miller was
the last person to look at this in some detail, I think.

Other hinderances may come from the GUI layer, since figures store
pointers to their canvases which in some cases come from GUI extension
code that may not support pickling. But we can fairly easy decouple
the figure from the canvas at pickle time and deal with pure mpl,
numpy and python objects. The main work is to add pickle
serialization to the mpl extension code.

···

On 2/7/07, Edin Salkovic <edin.salkovic@...287...> wrote:

Why can't mpl's figures be pickled?

Why can't mpl's figures be pickled?

The main thing is we need to add pickle support for all of mpl's extension code

  http://docs.python.org/lib/node321.html

In earlier attempts people got stuck with trying to pickle the
CXX extension code, which was causing some problems, but these
problems may be fixed in more recent versions of CXX. Todd Miller was
the last person to look at this in some detail, I think.

I think Todd did get it to work, but I'll copy him on this just to make
sure.

···

On Feb 7, 2007, at 10:21 AM, John Hunter wrote:

On 2/7/07, Edin Salkovic <edin.salkovic@...287...> wrote:

Other hinderances may come from the GUI layer, since figures store
pointers to their canvases which in some cases come from GUI extension
code that may not support pickling. But we can fairly easy decouple
the figure from the canvas at pickle time and deal with pure mpl,
numpy and python objects. The main work is to add pickle
serialization to the mpl extension code.

-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier.
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users

Perry Greenfield wrote:

Why can't mpl's figures be pickled?
      

The main thing is we need to add pickle support for all of mpl's extension code

  http://docs.python.org/lib/node321.html

In earlier attempts people got stuck with trying to pickle the
CXX extension code, which was causing some problems, but these
problems may be fixed in more recent versions of CXX. Todd Miller was
the last person to look at this in some detail, I think.

I think Todd did get it to work, but I'll copy him on this just to make
sure.
  

I looked at this in the context of numarray session saving and restoring. In that context, I believed there was a general problem with extension types not being picklable as a matter of developer expediency: first order, pickling support often doesn't get done. So my approach was to fudge a little and create "proxy" objects for things which wouldn't pickle rather than "fix all extension types." Where I left off CXX still didn't support pickling but a Python session with matplotlib and numarray could be saved; numarray arrays would be preserved, matplotlib objects would be "proxied" but unfortunately the proxies don't work in that case.

Todd

···

On Feb 7, 2007, at 10:21 AM, John Hunter wrote:

On 2/7/07, Edin Salkovic <edin.salkovic@...287...> wrote:
Other hinderances may come from the GUI layer, since figures store
pointers to their canvases which in some cases come from GUI extension
code that may not support pickling. But we can fairly easy decouple
the figure from the canvas at pickle time and deal with pure mpl,
numpy and python objects. The main work is to add pickle
serialization to the mpl extension code.

---------------------------------------------------------------------- ---
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier.
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel? cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users
    
-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier.
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users