* Ryan Krauss <[EMAIL PROTECTED]> [070622 09:47]:
> I don't think we are actually disagreeing with one another.  I have
> written the kind of library you are talking about and used the same
> library from ipython and in a wxpython app.  All of my plotting
> functions expect a fig instance as an input.  When calling the library
> from ipython, I pass in a fig=pylab.figure(), when using the data
> analysis library with wxpython, my fig comes from the get_figure
> method of a wxmpl PlotPanel instance.  wxmpl handles all canvas issues
> for me.
> 
> So, in my libraries, I have inputs that are fig instances.  Creating a
> fig with pylab.figure() is how I use my library from ipython.
> 
> I actually have this code in one of my data analysis library functions
> 
> def plotting_function(x, y, other inputs, fig=None):
>    if fig is None:
>       from pylab import figure
>       fig = figure(fignum)
> 
> and the code works beautifully as a library and plays well with
> ipython and wxpython.

Hello,

very nice! The only remaining problem is that an analysis library
functions might return several figures. In my case the data depends on
several parameters, and the function returns a dictionary containing for each
parameter set statistics, histograms and plots. The user should be able
to decide for which parameter he wants to pop up a plot, or save it to a
file, but for your approach all these windows pop up automatically, and
not only when the user does a fig.show() for the figure he is interested
in. Unfortunately the latter does not work if the figure is an
matplotlib.figure.Figure() instance, as in my approach.

Best Regards, Roman

-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users

Reply via email to