[Matplotlib-users] moving line

2014-04-18 Thread Michael Mossey
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


Re: [Matplotlib-users] removing a plot from an axes

2014-04-18 Thread Eric Firing
On 2014/04/18 12:21 PM, Michael Mossey wrote:
> Sorry for what is a beginnerish question but I'm having  a hard time
> using the docs. I want to remove a previous plot from an axes. How do I
> do this?

If you want to clear the axes, call the "cla()" or "clear()" method.
If you want to remove an artist such as a line, call its "remove()" method.

>
> Incidentally, it makes the docs hard to use that there are so many
> methods on Axes which are spread a great distance over the page. It
> would be nice to have a concise listing of the methods of Axes.

I agree. What is needed is a listing of methods by category instead of 
all together as a single alphabetical list.  In the meantime, you might 
find browsing the User Guide to be of some help.  Also, the "Quick 
Search" box can help.

Eric

>
> Note that I'm not using pyplot, but I think the term for what I'm doing
> is using the API. I'm subclassing FigureCanvas in PyQt, creating a
> Figure, and creating an axes using Figure.add_subplot().
>
> 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


Re: [Matplotlib-users] removing a plot from an axes

2014-04-18 Thread Adam Hughes
This will clear the figure:

plt.clf()

Is this what you're looking for, or just to pop one plot form the stack?


On Fri, Apr 18, 2014 at 6:21 PM, Michael Mossey wrote:

> Sorry for what is a beginnerish question but I'm having  a hard time using
> the docs. I want to remove a previous plot from an axes. How do I do this?
>
> Incidentally, it makes the docs hard to use that there are so many methods
> on Axes which are spread a great distance over the page. It would be nice
> to have a concise listing of the methods of Axes.
>
> Note that I'm not using pyplot, but I think the term for what I'm doing is
> using the API. I'm subclassing FigureCanvas in PyQt, creating a Figure, and
> creating an axes using Figure.add_subplot().
>
> 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


[Matplotlib-users] removing a plot from an axes

2014-04-18 Thread Michael Mossey
Sorry for what is a beginnerish question but I'm having  a hard time using
the docs. I want to remove a previous plot from an axes. How do I do this?

Incidentally, it makes the docs hard to use that there are so many methods
on Axes which are spread a great distance over the page. It would be nice
to have a concise listing of the methods of Axes.

Note that I'm not using pyplot, but I think the term for what I'm doing is
using the API. I'm subclassing FigureCanvas in PyQt, creating a Figure, and
creating an axes using Figure.add_subplot().

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