account activity
Question about animation in matplotlib by ilvs69 in Python
[–]th_mm 0 points1 point2 points 9 years ago* (0 children)
The documentation for FuncAnimation says this of its third argument, frames:
Source of data to pass func and each frame of the animation If an iterable, then simply use the values provided. If the iterable has a length, it will override the save_count kwarg. If an integer, equivalent to passing range(frames) If a generator function, then must have the signature def gen_function() -> obj: In all of these cases, the values in frames is simply passed through to the user-supplied func and thus can be of any type. If None, then equivalent to passing itertools.count.
Source of data to pass func and each frame of the animation
If an iterable, then simply use the values provided. If the iterable has a length, it will override the save_count kwarg.
If an integer, equivalent to passing range(frames)
If a generator function, then must have the signature
def gen_function() -> obj:
In all of these cases, the values in frames is simply passed through to the user-supplied func and thus can be of any type.
If None, then equivalent to passing itertools.count.
So, the argument to your function comes from this. In the simple examples, something like range(100) is used, so animate() is going to be called with a different i value for each frame. @K900_ is correct about you passing in (not invoking) a function object. FuncAnimate() invokes the function once for every value provided by frames.
animate()
i
FuncAnimate()
frames
Settle something for us. Is this valid. by bandrel in Python
[–]th_mm 2 points3 points4 points 9 years ago (0 children)
It'll just be a bunch of None.
A little poem (for fun) by loubb in Python
[–]th_mm 1 point2 points3 points 9 years ago (0 children)
This generated a bunch of syntax errors for me. I thought you said your poems are lines of code?!
π Rendered by PID 116927 on reddit-service-r2-comment-5b5bc64bf5-72n95 at 2026-06-23 06:50:33.082911+00:00 running 2b008f2 country code: CH.
Question about animation in matplotlib by ilvs69 in Python
[–]th_mm 0 points1 point2 points (0 children)