On Sat, Aug 1, 2009 at 12:05 PM, Mark Rubelmann<mrubelm...@gmail.com> wrote:
> Hi,
>
> I'm writing a script to plot data being read from a serial connection in
> real time.  I'm trying to use an idle_event callback to continually read the
> incoming data and plot it.  The problem is that the callback is only getting
> invoked once.  I found this page:
> http://www.scipy.org/Cookbook/Matplotlib/Animations, which suggests using
> backend-specific stuff.  This is intended to be a quick-and-dirty thing
> though so I was really hoping to avoid that.  Here's my code:

Wriing a GUI neutal idle event handler is not easy -- I've spent some
time on it but crashed and burned on tk -- but my guess is that the
problem you are having in your code is that GTK expects you to return
True is you want the func to be called again.  As soon as you return
False the event handler is terminated.  You return nothing, which is
None, which is False.  A simple "return True" may cure what ails you
vis-a-vis gtk.  But pylab animation is not supported, so I suggest
that you code to your GUI of choice for animation until we get a
proper GUI neutral animation event API.

JDH

------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day 
trial. Simplify your report design, integration and deployment - and focus on 
what you do best, core application coding. Discover what's new with 
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users

Reply via email to