Hi Mike,

Have you tried blitting? That prevents the draw from redrawing everything
on the plot, allowing it to only redraw the single line that's moving,
which should help any issues with speed. See some of the
examples<http://matplotlib.org/examples/animation/index.html>with
FuncAnimation and also a Q&A using the draw method
here<https://stackoverflow.com/questions/8955869/why-is-plotting-with-matplotlib-so-slow/8956211#8956211>,
which might work more smoothly with QTimer.

Ray


On Sat, Apr 19, 2014 at 12:56 AM, Michael Mossey <michaelmos...@gmail.com>wrote:

> I'm creating a simple little sound file editor, which includes the ability
> to play a sound file as a vertical line (a "cursor") moves across the plot
> of the waveform in sync with the sound. So the trick is, how to create this
> moving line. First I tried FuncAnimation, but I had problems with the
> synchronization with the sound. I'm guessing that the animation
> capabilities of matplotlib weren't really designed to be synchronized with
> outside activities. So then I tried using QTimer's and modifying the Line2D
> instance that is the vertical bar. This didn't work unless I called draw()
> on the figure canvas every time I modified the Line2D, which caused
> slowdown (probably because my audio data consists of 1000's of points).
>
> So is there a way to animate a vertical line moving across the plot with
> good control over exact timing, in the presence of other plots with
> thousands of points?
>
> Mike
>
>
>
> ------------------------------------------------------------------------------
> Learn Graph Databases - Download FREE O'Reilly Book
> "Graph Databases" is the definitive new guide to graph databases and their
> applications. Written by three acclaimed leaders in the field,
> this first edition is now available. Download your free book today!
> http://p.sf.net/sfu/NeoTech
> _______________________________________________
> Matplotlib-users mailing list
> Matplotlib-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
>
>
------------------------------------------------------------------------------
Learn Graph Databases - Download FREE O'Reilly Book
"Graph Databases" is the definitive new guide to graph databases and their
applications. Written by three acclaimed leaders in the field,
this first edition is now available. Download your free book today!
http://p.sf.net/sfu/NeoTech
_______________________________________________
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users

Reply via email to