XML plotting

Hi. A long while ago I had sent out an email asking if anyone was interested in an XML library for plotting with matplotlib. It seemed the general consensus was no, though it might be nice as a backend for saving files. So I developed the XML library for my own purposes, and have been using it for some time.

I thought I might as well clean it up, package it, and release it in the wild. I'm not sure if this would even qualify as an alpha release, perhaps more of a RFC, but if anyone is interested, and wants to give some comments, let me know. While it has gotten a good amount of use (including a soon to be published paper), it has evolved to fit my needs more than anything else. So in the clean up, I tried to refractor some saneness into it, and had to fix some things in the process. I tried to test as much of it as possible, but I'm sure I forgot some obvious things as well.

It is trying to serve 3 purposes:
(1) Framework for making publishable figures easy
(2) Provide an easy way to allow pylab figures to be saveable/loadable and editable by human
(3) Provide a general framework for a higher level plotting library

I'm hoping to in the near future write the backend to pylab to save in the XML format. It should (hopefully) be fairly trivial..

It can be found (this includes some documentation and examples):
www.cns.nyu.edu/~abes/xmlplot.tar.gz

Thanks,

Abe

Dear Abraham,

I'm sorry it's taken so long to get back to you. I didn't see any other
responses on the list, but I think this is a super idea (although I have
yet to look at the code). In particular I like your idea to save to your
XML format. Then we could plot to an XML file, and replot (later) with
whatever backend we need at the time. It sounds great. We could even zip
the file automatically (or just the data parts of the innards) so they'd
hopefully be pretty small.

I suspect that if you get the XML backend working and incorporate it,
you'll have a lot of users trying it out when they see it in their "save
as" format list.

Relatedly, is there any way would could add to the SVG backend that
would give us essentially this and, simultaneously, a valid SVG file? Is
SVG even "officially" extensible in this way? (I don't know much about
SVG or XML.)

Cheers!
Andrew

Abraham Schneider wrote:

···

Hi. A long while ago I had sent out an email asking if anyone was
interested in an XML library for plotting with matplotlib. It seemed
the general consensus was no, though it might be nice as a backend for
saving files. So I developed the XML library for my own purposes, and
have been using it for some time.

I thought I might as well clean it up, package it, and release it in
the wild. I'm not sure if this would even qualify as an alpha release,
perhaps more of a RFC, but if anyone is interested, and wants to give
some comments, let me know. While it has gotten a good amount of use
(including a soon to be published paper), it has evolved to fit my
needs more than anything else. So in the clean up, I tried to
refractor some saneness into it, and had to fix some things in the
process. I tried to test as much of it as possible, but I'm sure I
forgot some obvious things as well.

It is trying to serve 3 purposes:
(1) Framework for making publishable figures easy
(2) Provide an easy way to allow pylab figures to be saveable/loadable
and editable by human
(3) Provide a general framework for a higher level plotting library

I'm hoping to in the near future write the backend to pylab to save in
the XML format. It should (hopefully) be fairly trivial..

It can be found (this includes some documentation and examples):
www.cns.nyu.edu/~abes/xmlplot.tar.gz

Thanks,

Abe

-------------------------------------------------------
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-devel mailing list
Matplotlib-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-devel

Hey, glad it might actually be of use to other people. I know I've been awful about finishing things, as anything that doesn't directly relate to my thesis has fallen to wayside as of late. When I was investigating saving it as an XML format, I remember coming across a problem. If I remember correctly, you could easily write a backend that would just spit out the proper XML, but it wouldn't be a very good XML file -- it would just be a collection of 'draw_lines', etc.. The current format that I've been using looks more like:

<pylab>
<figure name="foo">
<axes pos="1,1">
  <plot name="bar">
    <params name="a" value="10.5" type="float"/>
    <params name="b" value="baz" type="str"/>
  </plot>
</axes>

<axes pos="1,2">
  <plot name="bar">
    <params name="a" value="0.53" type="float"/>
    <params name="b" value="zab" type="str"/>
</axes>
</figure>
</pylab>

It has a plug-in architecture, so it looks for all python files in a specified directory, and that is how it decides which plot function to call (in this case, it would find a class 'bar' within those files). The class specifies what arguments it can take, which are required arguments, and which are optional (as well as default values).

What made sense to me, would be to simply create plot classes that corresponded with the draw_line, draw_arc, etc. That way, to render a saved XML file, would simply consist of having those classes make the correct backend calls. But, there doesn't seem an easy way to generate this with the backends, as they know nothing about figures, axes, subplot, etc.

So it seems like matplotlib would have to have a separate way for saving a native format. I think this would be a huge gain, as it would allow figures to be generated, saved, edited, reopened/regenerated, but would involve yet another output method.

I could very well be missing something obvious, if so please correct me!

As for the SVG, I'll have to look into it. I think that's probably an easier issue, as I believe you could construct it in a similiar fashion to the other backends, as a collection of lines.

Abe

···

On Aug 7, 2006, at 4:14 PM, Andrew Straw wrote:

Dear Abraham,

I'm sorry it's taken so long to get back to you. I didn't see any other
responses on the list, but I think this is a super idea (although I have
yet to look at the code). In particular I like your idea to save to your
XML format. Then we could plot to an XML file, and replot (later) with
whatever backend we need at the time. It sounds great. We could even zip
the file automatically (or just the data parts of the innards) so they'd
hopefully be pretty small.

I suspect that if you get the XML backend working and incorporate it,
you'll have a lot of users trying it out when they see it in their "save
as" format list.

Relatedly, is there any way would could add to the SVG backend that
would give us essentially this and, simultaneously, a valid SVG file? Is
SVG even "officially" extensible in this way? (I don't know much about
SVG or XML.)

Cheers!
Andrew

Abraham Schneider wrote:

Hi. A long while ago I had sent out an email asking if anyone was
interested in an XML library for plotting with matplotlib. It seemed
the general consensus was no, though it might be nice as a backend for
saving files. So I developed the XML library for my own purposes, and
have been using it for some time.

I thought I might as well clean it up, package it, and release it in
the wild. I'm not sure if this would even qualify as an alpha release,
perhaps more of a RFC, but if anyone is interested, and wants to give
some comments, let me know. While it has gotten a good amount of use
(including a soon to be published paper), it has evolved to fit my
needs more than anything else. So in the clean up, I tried to
refractor some saneness into it, and had to fix some things in the
process. I tried to test as much of it as possible, but I'm sure I
forgot some obvious things as well.

It is trying to serve 3 purposes:
(1) Framework for making publishable figures easy
(2) Provide an easy way to allow pylab figures to be saveable/loadable
and editable by human
(3) Provide a general framework for a higher level plotting library

I'm hoping to in the near future write the backend to pylab to save in
the XML format. It should (hopefully) be fairly trivial..

It can be found (this includes some documentation and examples):
www.cns.nyu.edu/~abes/xmlplot.tar.gz

Thanks,

Abe

-------------------------------------------------------
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-devel mailing list
Matplotlib-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-devel

-------------------------------------------------------------------------
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-devel mailing list
Matplotlib-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-devel