On Thursday, March 1, 2012, Jerzy Karczmarczuk <
jerzy.karczmarc...@unicaen.fr> wrote:
> Andrea Gavana :
>> Anyway, if I am not completely off-track, this is something I had been
>> looking for as well in matplotlib a while back (3, 4 years ago), but
>> at that time I was told it would have been complicated to implement it
>> for all the "live" backend (I can't recall the exact reason).
>>
>> I would say that, at least for the backends based on wxPython, this
>> kind of modify-the-live-plot-via-GUI-interaction should be relatively
>> straightforward, at least for the GUI part and for the basics (line
>> styles, colours, markers and so on).
> There is one non-trivial difference between Matplotlib and Matlab.
> Matplotlib is "just" a library, and not an integrated package with its
> own event processing loop, multithreading, etc. When you plot()
> something under Matlab or Scilab, you generate some objecs (gcf, gca)
> and other stuff, accessible from outside. Your program turns normally,
> your console works. So, you may launch a procedure which analyses all
> the plotted data and change the "patches", "lines", "collections", etc.,
> using the matplotlib jargon.
>
> In matplotlib, upon show(), you relinquish the control. The interaction
> becomes clumsy, the animation becomes clumsy, since matplotlib doesn't
> give you the full access to the event loop.
> OF COURSE you may do it, but it will require some work.
> One possibility is to use an interface which by design works (I
> presume...)  in a separate, non-blocking thread. I mean: IPython. If you
> launch IPython --pylab, then you may, e.g. construct:
>
> x=linspace(0.0,25.0,300);  y=sin(x)
> plot(x,y)
>
> and the figure is created without show().
> Then, write:
>
> a=gca(); p=a.lines[0]
>
> and nothing more difficult than:
>
> p.set_lw(3); p.set_color('red'); draw()
>
> You have edited your line. No need to change the code of matplotlib.
>
> Good luck.
>
> Jerzy Karczmarczuk
>
>

Just to be clear, you are speaking of the difference between interactive
and non-interactive modes, which is entirely switchable in matplotlib.
 However, widgets can be used in either mode. mpl can do what matlab can
do, and more -- in theory.  We simply do not have all the widgets and tools
made.

Ipython uses mpl with interactive mode turned on. All artists are available
for editing at any time *until* the figure is destroyed (in either mode).
 It just happens that the execution moves past show() in non-interactive
mode only when the figures are destroyed.

As for any clumsiness for animations, it is because the feature is still
new and Ryan May and I would greatly welcome additional viewpoints in the
design discussions.

Ben Root
------------------------------------------------------------------------------
Virtualization & Cloud Management Using Capacity Planning
Cloud computing makes use of virtualization - but cloud computing 
also focuses on allowing computing to be delivered as a service.
http://www.accelacomm.com/jaw/sfnl/114/51521223/
_______________________________________________
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users

Reply via email to