[IPOL discuss] ipol_demo, matplotlib and other modules [ Re: Noise estimation ready in dev. server ]

Pascal Getreuer getreuer at gmail.com
Thu Apr 28 18:30:58 CEST 2011


Hi Miguel,

You make a valid point that rendering figures is a basic need for
scientific presentation and that it is tedious to write such figure
rendering code from scratch.

However, I agree with Nicolas that minimizing dependencies is critical
for the long term because IPOL does not have the resources for
continual maintenance of all demos.  Furthermore, many useful kinds of
figures (line plots, bar graphs, vector fields, contour maps, ...) can
be constructed using a basic 2D line rendering function, say,
something of the form

image.draw_line((x1, y1, x2, y2), color)

So from a maintenance point of view, it is best if demos either
implement plotting themselves using a simple "draw_line" function, or
if more plotting power is needed, to use a stable library like GNU
plotutils (http://www.gnu.org/software/plotutils/).

Nicolas and Jose-Luis have already written a function using PIL to
render histogram plots.  It is also manageable to implement a
"draw_line" function in about 100 lines of C, so basic 2D plots are
also possible in C without special libraries.

Best,
Pascal



On Thu, Apr 28, 2011 at 16:54, Miguel Colom
<Miguel.Colom at cmla.ens-cachan.fr> wrote:
>> I didn't study the matplotlib API stability. What I say is that we can
>> not use another python module for the only reason that it is
>> useful (or convenoient or nice). The only dependencies for the moment
>> are cherrypy, PIL, tar/zip and sqlite modules, and there already are
>> some compatibility problems, as explained before. I think we should
>> only consider additional dependencies if they are useful and can not
>> be replaced by internal tools and we have some reason to think they
>> will be available without API break for a *long* time.
>
> Well, a library to draw figures is a major need for the IPOL, in my opinion.
> I think that the noise estimation demo is the first one that generates
> figures, but many other demos will follow.
> Figures are essential to show results in a scientific publication.
>
> Implementing the figures inside the C code is waste of time. And the way
> the data in a figure is presented should be absolutely decoupled from the
> program that generates this data.
>
> Using the PIL is also possible, but this library only offers simple image
> manipulation, not the advanced 2D/3D plotting we need, like matplotlib.
>
>> No one wants to investigate the 200 demos we may have in 2015, some
>> written by people who went to other places, some badly documented or
>> badly written, in order to update the server without breaking the
>> service. Or if you want, please volunteer, but I certainly don't.
>
> We need a consensus on what plotting library to draw complex figures
> should be used. But we need one, for sure.
>
> I propose matplotlib because it's very easy to understand, based on Python
> (and it means that any modification on the drawing scripts is fast) and
> allows drawing complex 2D/3D figures.
>
> Its latest stable version was released three months ago, it's true. But I
> don't think that the API would change in such a way that it breaks the
> demos.
> The benefits that we can get by using matplotlib overtake absolutely the
> risks.
>
> I open this discussion open and I hope to read more opinions from all of you!
>
>
> _______________________________________________
> discuss mailing list
> discuss at list.ipol.im
> http://tools.ipol.im/mailman/listinfo/discuss
>


More information about the discuss mailing list