[Matplotlib-users] Re: animation.FuncAnimation example --- how does it work?

2015-04-23 Thread Virgil Stokes
Thanks for your reply to my post, Jerzy. On 23-Apr-2015 13:18, Jerzy Karczmarczuk wrote: Le 23/04/2015 12:22, Virgil Stokes a écrit : The following interesting example (random_data.py) is posted at: http://matplotlib.org/1.4.2/examples/animation/random_data.html import matplotlib.pyplot

Re: [Matplotlib-users] animation.FuncAnimation example --- how does it work?

2015-04-23 Thread Benjamin Root
The documentation should say the number, not a number. This particular argument expects either a generator, an iterable, or an integer. If none is given, it will try and figure out something for itself. The integer is used to create a number generator, and so you effectively have an iterable that

Re: [Matplotlib-users] animation.FuncAnimation example --- how does it work?

2015-04-23 Thread Thomas Caswell
Can everyone please bring the level of snark/hostility down? Programming is frustrating, but antagonizing the mailing list does not help anyone. It is not well documented, but the signature for `func` is assumed to be `def function(required, *optional_positional)` see

Re: [Matplotlib-users] animation.FuncAnimation example --- how does it work?

2015-04-23 Thread Jerzy Karczmarczuk
Animation problem of Virgil Stokes. Since I began the answer sequence, here's a little more. If this overlaps other answers, I apologize. About the third parameter /frames/ can be a generator, an iterable, or a number of frames. This makes very little sense to me --- what does or a number of

Re: [Matplotlib-users] animation.FuncAnimation example --- how does it work?

2015-04-23 Thread Benjamin Root
Brendan, good catch, I didn't notice Virgil's confusion earlier. I think that is a good explanation. I remember getting very confused by all of that stuff back when I started in Python. I think mostly because I don't know of any other language that does argument handling like how Python does it. I

Re: [Matplotlib-users] animation.FuncAnimation example --- how does it work?

2015-04-23 Thread Brendan Barnwell
On 2015-04-23 03:22, Virgil Stokes wrote: 1. There are 3 positional arguments given for animation.FuncAnimation; but, in the API documentation for this class (http://matplotlib.org/api/animation_api.html), only two positional arguments are shown. One thing I think may be misleading

Re: [Matplotlib-users] animation.FuncAnimation example --- how does it work?

2015-04-23 Thread Virgil Stokes
On 23-Apr-2015 18:48, Benjamin Root wrote: ... keeping conversation on-list ... The reason why you get that error is because you took out the argument from the call signature. But, FuncAnimation assumes that it can send in at least one argument. That argument is not optional, even if you

Re: [Matplotlib-users] animation.FuncAnimation example --- how does it work?

2015-04-23 Thread Benjamin Root
... keeping conversation on-list ... The reason why you get that error is because you took out the argument from the call signature. But, FuncAnimation assumes that it can send in at least one argument. That argument is not optional, even if you aren't using it. So, animate() was called with an

[Matplotlib-users] animation.FuncAnimation example --- how does it work?

2015-04-23 Thread Virgil Stokes
The following interesting example (random_data.py) is posted at: http://matplotlib.org/1.4.2/examples/animation/random_data.html import matplotlib.pyplot as plt import matplotlib.animation as animation fig, ax = plt.subplots() line, = ax.plot(np.random.rand(10)) ax.set_ylim(0, 1) def

Re: [Matplotlib-users] animation.FuncAnimation example --- how does it work?

2015-04-23 Thread Jerzy Karczmarczuk
Le 23/04/2015 12:22, Virgil Stokes a écrit : The following interesting example (random_data.py) is posted at: http://matplotlib.org/1.4.2/examples/animation/random_data.html import matplotlib.pyplot as plt import matplotlib.animation as animation import numpy as np fig, ax =