@@ -1520,12 +1520,24 @@ class FuncAnimation(TimedAnimation):
1520
1520
func : callable
1521
1521
The function to call at each frame. The first argument will
1522
1522
be the next value in *frames*. Any additional positional
1523
- arguments can be supplied via the *fargs* parameter.
1523
+ arguments can be supplied using `functools.partial` or via the *fargs*
1524
+ parameter.
1524
1525
1525
1526
The required signature is::
1526
1527
1527
1528
def func(frame, *fargs) -> iterable_of_artists
1528
1529
1530
+ It is often more convenient to provide the arguments using
1531
+ `functools.partial`. In this way it is also possible to pass keyword
1532
+ arguments. To pass a function with both positional and keyword
1533
+ arguments, set all arguments as keyword arguments, just leaving the
1534
+ *frame* argument unset::
1535
+
1536
+ def func(frame, x, *, y=None):
1537
+ ...
1538
+
1539
+ ani = FuncAnimation(fig, partial(func, x=1, y='foo'))
1540
+
1529
1541
If ``blit == True``, *func* must return an iterable of all artists
1530
1542
that were modified or created. This information is used by the blitting
1531
1543
algorithm to determine which parts of the figure have to be updated.
@@ -1565,7 +1577,7 @@ def init_func() -> iterable_of_artists
1565
1577
1566
1578
fargs : tuple or None, optional
1567
1579
Additional arguments to pass to each call to *func*. Note: the use of
1568
- `functools.partial` is preferred over *fargs*.
1580
+ `functools.partial` is preferred over *fargs*. See *func* for details.
1569
1581
1570
1582
save_count : int, default: 100
1571
1583
Fallback for the number of values from *frames* to cache. This is
0 commit comments