@@ -205,12 +205,12 @@ def setup(self, fig, outfile, dpi=None):
205
205
Parameters
206
206
----------
207
207
fig : `~matplotlib.figure.Figure`
208
- The figure object that contains the information for frames
208
+ The figure object that contains the information for frames.
209
209
outfile : str
210
- The filename of the resulting movie file
211
- dpi : int, optional
210
+ The filename of the resulting movie file.
211
+ dpi : int, optional, default: ``fig.dpi``
212
212
The DPI (or resolution) for the file. This controls the size
213
- in pixels of the resulting movie file. Default is ``fig.dpi``.
213
+ in pixels of the resulting movie file.
214
214
"""
215
215
self .outfile = outfile
216
216
self .fig = fig
@@ -338,19 +338,7 @@ def _adjust_frame_size(self):
338
338
return w , h
339
339
340
340
def setup (self , fig , outfile , dpi = None ):
341
- """
342
- Perform setup for writing the movie file.
343
-
344
- Parameters
345
- ----------
346
- fig : `~matplotlib.figure.Figure`
347
- The figure object that contains the information for frames
348
- outfile : str
349
- The filename of the resulting movie file
350
- dpi : int, optional
351
- The DPI (or resolution) for the file. This controls the size
352
- in pixels of the resulting movie file. Default is fig.dpi.
353
- """
341
+ # docstring inherited
354
342
super ().setup (fig , outfile , dpi = dpi )
355
343
self ._w , self ._h = self ._adjust_frame_size ()
356
344
# Run here so that grab_frame() can write the data to a pipe. This
@@ -896,25 +884,23 @@ class Animation:
896
884
Parameters
897
885
----------
898
886
fig : `~matplotlib.figure.Figure`
899
- The figure object that is used to get draw, resize, and any
900
- other needed events.
887
+ The figure object used to get needed events, such as draw or resize.
901
888
902
889
event_source : object, optional
903
- A class that can run a callback when desired events
904
- are generated, as well as be stopped and started.
890
+ A class that can run a callback when desired events
891
+ are generated, as well as be stopped and started.
905
892
906
- Examples include timers (see :class: `TimedAnimation`) and file
907
- system notifications.
893
+ Examples include timers (see `TimedAnimation`) and file
894
+ system notifications.
908
895
909
- blit : bool, optional
910
- controls whether blitting is used to optimize drawing. Defaults
911
- to ``False``.
896
+ blit : bool, default: False
897
+ Whether blitting is used to optimize drawing.
912
898
913
899
See Also
914
900
--------
915
901
FuncAnimation, ArtistAnimation
916
-
917
902
"""
903
+
918
904
def __init__ (self , fig , event_source = None , blit = False ):
919
905
self ._fig = fig
920
906
# Disables blitting for backends that don't support it. This
@@ -1393,25 +1379,18 @@ class TimedAnimation(Animation):
1393
1379
Parameters
1394
1380
----------
1395
1381
fig : `~matplotlib.figure.Figure`
1396
- The figure object that is used to get draw, resize, and any
1397
- other needed events.
1398
-
1399
- interval : number, optional
1400
- Delay between frames in milliseconds. Defaults to 200.
1401
-
1402
- repeat_delay : number, optional
1403
- If the animation in repeated, adds a delay in milliseconds
1404
- before repeating the animation. Defaults to ``None``.
1405
-
1406
- repeat : bool, optional
1407
- Controls whether the animation should repeat when the sequence
1408
- of frames is completed. Defaults to ``True``.
1409
-
1410
- blit : bool, optional
1411
- Controls whether blitting is used to optimize drawing. Defaults
1412
- to ``False``.
1413
-
1382
+ The figure object used to get needed events, such as draw or resize.
1383
+ interval : int, default: 200
1384
+ Delay between frames in milliseconds.
1385
+ repeat_delay : int, default: 0
1386
+ The delay in milliseconds between consecutive animation runs, if
1387
+ *repeat* is True.
1388
+ repeat : bool, default: True
1389
+ Whether the animation repeats when the sequence of frames is completed.
1390
+ blit : bool, default: False
1391
+ Whether blitting is used to optimize drawing.
1414
1392
"""
1393
+
1415
1394
def __init__ (self , fig , interval = 200 , repeat_delay = None , repeat = True ,
1416
1395
event_source = None , * args , ** kwargs ):
1417
1396
# Store the timing information
@@ -1452,7 +1431,7 @@ def _step(self, *args):
1452
1431
1453
1432
def _stop (self , * args ):
1454
1433
# If we stop in the middle of a loop delay (which is relatively likely
1455
- # given the potential pause here, remove the loop_delay callback as
1434
+ # given the potential pause here) , remove the loop_delay callback as
1456
1435
# well.
1457
1436
self .event_source .remove_callback (self ._loop_delay )
1458
1437
Animation ._stop (self )
@@ -1475,30 +1454,21 @@ class ArtistAnimation(TimedAnimation):
1475
1454
Parameters
1476
1455
----------
1477
1456
fig : `~matplotlib.figure.Figure`
1478
- The figure object that is used to get draw, resize, and any
1479
- other needed events.
1480
-
1457
+ The figure object used to get needed events, such as draw or resize.
1481
1458
artists : list
1482
- Each list entry a collection of artists that represent what
1483
- needs to be enabled on each frame. These will be disabled for
1484
- other frames.
1485
-
1486
- interval : number, optional
1487
- Delay between frames in milliseconds. Defaults to 200.
1488
-
1489
- repeat_delay : number, optional
1490
- If the animation in repeated, adds a delay in milliseconds
1491
- before repeating the animation. Defaults to ``None``.
1492
-
1493
- repeat : bool, optional
1494
- Controls whether the animation should repeat when the sequence
1495
- of frames is completed. Defaults to ``True``.
1496
-
1497
- blit : bool, optional
1498
- Controls whether blitting is used to optimize drawing. Defaults
1499
- to ``False``.
1500
-
1459
+ Each list entry is a collection of artists that are made visible on
1460
+ the corresponding frame. Other artists are made invisible.
1461
+ interval : int, default: 200
1462
+ Delay between frames in milliseconds.
1463
+ repeat_delay : int, default: 0
1464
+ The delay in milliseconds between consecutive animation runs, if
1465
+ *repeat* is True.
1466
+ repeat : bool, default: True
1467
+ Whether the animation repeats when the sequence of frames is completed.
1468
+ blit : bool, default: False
1469
+ Whether blitting is used to optimize drawing.
1501
1470
"""
1471
+
1502
1472
def __init__ (self , fig , artists , * args , ** kwargs ):
1503
1473
# Internal list of artists drawn in the most recent frame.
1504
1474
self ._drawn_artists = []
@@ -1550,23 +1520,22 @@ class FuncAnimation(TimedAnimation):
1550
1520
Parameters
1551
1521
----------
1552
1522
fig : `~matplotlib.figure.Figure`
1553
- The figure object that is used to get draw, resize, and any
1554
- other needed events.
1523
+ The figure object used to get needed events, such as draw or resize.
1555
1524
1556
1525
func : callable
1557
- The function to call at each frame. The first argument will
1558
- be the next value in *frames*. Any additional positional
1559
- arguments can be supplied via the *fargs* parameter.
1526
+ The function to call at each frame. The first argument will
1527
+ be the next value in *frames*. Any additional positional
1528
+ arguments can be supplied via the *fargs* parameter.
1560
1529
1561
- The required signature is::
1530
+ The required signature is::
1562
1531
1563
- def func(frame, *fargs) -> iterable_of_artists
1532
+ def func(frame, *fargs) -> iterable_of_artists
1564
1533
1565
- If ``blit == True``, *func* must return an iterable of all artists
1566
- that were modified or created. This information is used by the blitting
1567
- algorithm to determine which parts of the figure have to be updated.
1568
- The return value is unused if ``blit == False`` and may be omitted in
1569
- that case.
1534
+ If ``blit == True``, *func* must return an iterable of all artists
1535
+ that were modified or created. This information is used by the blitting
1536
+ algorithm to determine which parts of the figure have to be updated.
1537
+ The return value is unused if ``blit == False`` and may be omitted in
1538
+ that case.
1570
1539
1571
1540
frames : iterable, int, generator function, or None, optional
1572
1541
Source of data to pass *func* and each frame of the animation
@@ -1586,47 +1555,44 @@ def gen_function() -> obj
1586
1555
to the user-supplied *func* and thus can be of any type.
1587
1556
1588
1557
init_func : callable, optional
1589
- A function used to draw a clear frame. If not given, the
1590
- results of drawing from the first item in the frames sequence
1591
- will be used. This function will be called once before the
1592
- first frame.
1558
+ A function used to draw a clear frame. If not given, the results of
1559
+ drawing from the first item in the frames sequence will be used. This
1560
+ function will be called once before the first frame.
1593
1561
1594
- The required signature is::
1562
+ The required signature is::
1595
1563
1596
- def init_func() -> iterable_of_artists
1564
+ def init_func() -> iterable_of_artists
1597
1565
1598
- If ``blit == True``, *init_func* must return an iterable of artists
1599
- to be re-drawn. This information is used by the blitting
1600
- algorithm to determine which parts of the figure have to be updated.
1601
- The return value is unused if ``blit == False`` and may be omitted in
1602
- that case.
1566
+ If ``blit == True``, *init_func* must return an iterable of artists
1567
+ to be re-drawn. This information is used by the blitting algorithm to
1568
+ determine which parts of the figure have to be updated. The return
1569
+ value is unused if ``blit == False`` and may be omitted in that case.
1603
1570
1604
1571
fargs : tuple or None, optional
1605
- Additional arguments to pass to each call to *func*.
1572
+ Additional arguments to pass to each call to *func*.
1606
1573
1607
1574
save_count : int, optional
1608
- The number of values from *frames* to cache.
1575
+ The number of values from *frames* to cache.
1609
1576
1610
- interval : number, optional
1611
- Delay between frames in milliseconds. Defaults to 200 .
1577
+ interval : int, default: 200
1578
+ Delay between frames in milliseconds.
1612
1579
1613
- repeat_delay : number, optional
1614
- If the animation in repeated, adds a delay in milliseconds
1615
- before repeating the animation. Defaults to *None* .
1580
+ repeat_delay : int, default: 0
1581
+ The delay in milliseconds between consecutive animation runs, if
1582
+ *repeat* is True .
1616
1583
1617
- repeat : bool, optional
1618
- Controls whether the animation should repeat when the sequence
1619
- of frames is completed. Defaults to *True*.
1584
+ repeat : bool, default: True
1585
+ Whether the animation repeats when the sequence of frames is completed.
1620
1586
1621
- blit : bool, optional
1622
- Controls whether blitting is used to optimize drawing. Note: when using
1623
- blitting any animated artists will be drawn according to their zorder.
1624
- However , they will be drawn on top of any previous artists, regardless
1625
- of their zorder. Defaults to *False* .
1587
+ blit : bool, default: False
1588
+ Whether blitting is used to optimize drawing. Note: when using
1589
+ blitting, any animated artists will be drawn according to their zorder;
1590
+ however , they will be drawn on top of any previous artists, regardless
1591
+ of their zorder.
1626
1592
1627
- cache_frame_data : bool, optional
1628
- Controls whether frame data is cached. Defaults to *True*.
1629
- Disabling cache might be helpful when frames contain large objects.
1593
+ cache_frame_data : bool, default: True
1594
+ Whether frame data is cached. Disabling cache might be helpful when
1595
+ frames contain large objects.
1630
1596
"""
1631
1597
1632
1598
def __init__ (self , fig , func , frames = None , init_func = None , fargs = None ,
0 commit comments