Files
intellecton/venv/lib/python3.12/site-packages/matplotlib/__pycache__/animation.cpython-312.pyc
T

713 lines
78 KiB
Plaintext
Raw Normal View History

Ë
†Rj ãó´—ddlZddlZddlZddlmZmZddlZddlZddlm Z ddl
Z
ddl Z ddl Z ddl
mZddlZddlZddlZddlmZddlZddlmZmZmZmZddlmZmZddlmZ ejBe"«Z#e jHdk(r e jJndZ&d „Z'Gd
„d «Z(e(«Z)Gd „d
ejT«Z+Gd„de+«Z,Gd„de,«Z-e)j]d«Gd„de+««Z/Gd„d«Z0e)j]d«Gd„de0e,««Z1e)j]d«Gd„de0e-««Z2Gd„d«Z3e)j]d«Gd „d!e3e,««Z4e)j]d"«Gd#„d$e3e-««Z5d%„Z6d&„Z7e)j]d'«Gd(„d)e-««Z8Gd*„d+«Z9Gd,„d-e9«Z:Gd.„d/e:«Z;Gd0„d1e:«Z<d2„Z=y)3éN)ÚBytesIOÚ
TextIOWrapper)ÚPath)ÚTemporaryDirectory)ÚImage)ÚDISPLAY_TEMPLATEÚINCLUDED_FRAMESÚ
JS_INCLUDEÚ
STYLE_INCLUDE)Ú_apiÚcbookÚwin32cóŒ—d„}t||z|z «|z|z }t||z|z «|z|z }||||«||||«fS)a,
Compute figure size so that pixels are a multiple of n.
Parameters
----------
w, h : float
Size in inches.
dpi : float
The dpi.
n : int
The target multiple.
Returns
-------
wnew, hnew : float
The new figure size in inches.
cóž—t||z«|zdk7r¸ttj|tj«|z«|zdk(r&tj|tj«}|Sttj|tj «|z«|zdk(r%tj|tj «}|S)Nr)ÚintÚnpÚ nextafterÚinf)ÚxÚdpiÚns úW/home/antigravity/intellecton/venv/lib/python3.12/site-packages/matplotlib/animation.pyÚcorrect_roundoffz*adjusted_figsize.<locals>.correct_roundoff7sœ€Ü ˆq�‰u‹:˜‰>˜QÒ Ü”2—<‘< ¤2§6¡6Ó*¨3Ñ.Ó/°!Ñ3°qÒ8Ü—L‘L ¤B§F¡FÓ+�ðˆô”R—\‘\ !¤b§f¡f WÓ-¨cÑ1Ó2°QÑ6¸!Ò;Ü—L‘L ¤R§V¡V GÓ,�؈ó)r)ÚwÚhrrrÚwnewÚhnews rÚadjusted_figsizer s_€ò.ô ˆq�3‰w˜‰{Ó ˜aÑ  #Ñ %€DÜ ˆq�3‰w˜‰{Ó ˜aÑ  #Ñ %€DÙ ˜D # qÓ )Ñ+;¸DÀ#ÀqÓ+IÐ IÐIrcó4—eZdZdZd„Zd„Zd„Zd„Zd„Zd„Z y) ÚMovieWriterRegistryz<Registry of available writer classes by human readable name.có"—t«|_y©N)ÚdictÚ _registered©Úselfs rÚ__init__zMovieWriterRegistry.__init__Gs €Ü›6ˆÕrc󇇗ˆˆfd„}|S)zª
Decorator for registering a class under a name.
Example use::
@registry.register(name)
class Foo:
pass
có&•—|‰j‰<|Sr#)r%)Ú
writer_clsÚnamer's €€rÚwrapperz-MovieWriterRegistry.register.<locals>.wrapperTsø€Ø%/ˆD× Ñ ˜TÑ "ØÐ r©)r'r,r-s`` rÚregisterzMovieWriterRegistry.registerJsù€õ ðˆrcó`— |j|}|j«S#t$rYywxYw)z¥
Check if given writer is available by name.
Parameters
----------
name : str
Returns
-------
bool
F)r%ÚKeyErrorÚ isAvailable)r'r,Úclss rÚ is_availablez MovieWriterRegistry.is_availableYs:€ð Ø×"Ñ" 4Ñ(ˆCð�‰Ó Ð øôò Ùð ús ‚!¡ -¬-c#óZK—|jD]}|j|«sŒ|–—Œy­w)z-Iterate over names of available writer class.N)r%r4©r'r,s rÚ__iter__zMovieWriterRegistry.__iter__ks.èø€à×$Ñ$ò ˆDØ× Ñ  Õ&Ø“
ñ ùs‚!+¤+có
—g|¢S)z%Get a list of available MovieWriters.r.r&s rÚlistzMovieWriterRegistry.listqs €à�ˆwˆrcó`—|j|«r|j|Std|›d�«‚)z,Get an available writer class from its name.zRequested MovieWriter (z) not available)r4r%Ú RuntimeErrorr6s rÚ __getitem__zMovieWriterRegistry.__getitem__us6€à × Ñ ˜TÔ "Ø×#Ñ# DÑ)Ð )ÜÐ4°T°F¸/ÐJÓKÐKrN)
Ú__name__Ú
__module__Ú __qualname__Ú__doc__r(r/r4r7r9r<r.rrr!r!Ds$„ÙFò"ò
ò!ò$ò óLrr!cóÀ—eZdZdZd
d„Zej d d„«Zed„«Z d„Z
ej d„«Z ej d„«Z e
jd „«Zy) ÚAbstractMovieWriteraœ
Abstract base class for writing movies, providing a way to grab frames by
calling `~AbstractMovieWriter.grab_frame`.
`setup` is called to start the process and `finish` is called afterwards.
`saving` is provided as a context manager to facilitate this process as ::
with moviewriter.saving(fig, outfile='myfile.mp4', dpi=100):
# Iterate over frames
moviewriter.grab_frame(**savefig_kwargs)
The use of the context manager ensures that `setup` and `finish` are
performed as necessary.
An instance of a concrete subclass of this class can be given as the
``writer`` argument of `Animation.save()`.
Ncó”—||_|�|ni|_tj|d«|_tj|d«|_y)Nzanimation.codecúanimation.bitrate)ÚfpsÚmetadataÚmplÚ
_val_or_rcÚcodecÚbitrate)r'rErFrIrJs rr(zAbstractMovieWriter.__init__’s=€ØˆŒØ$,Ð$8™¸bˆŒ
Ü—^‘^ EÐ+<Ó=ˆŒ
Ü—~‘~ gÐ/BÓCˆ� rcó¨—t|«jjd¬«||_||_|€|jj
}||_y)a¿
Setup for writing the movie file.
Parameters
----------
fig : `~matplotlib.figure.Figure`
The figure object that contains the information for frames.
outfile : str
The filename of the resulting movie file.
dpi : float, default: ``fig.dpi``
The DPI (or resolution) for the file. This controls the size
in pixels of the resulting movie file.
T©ÚstrictN)rÚparentÚresolveÚoutfileÚfigr)r'rQrPrs rÚsetupzAbstractMovieWriter.setup˜sF€ô
ˆW‹
×Ñ×$Ñ$¨DÐ$Ô1؈Œ ؈ŒØ ˆ;Ø—(‘(—,‘,ˆC؈�rcóœ—|jj«\}}t||jz«t||jz«fS)z7A tuple ``(width, height)`` in pixels of a movie frame.)rQÚget_size_inchesrr)r'rrs rÚ
frame_sizezAbstractMovieWriter.frame_size¯s?€ð�x‰x×'Ñ'Ó)‰ˆˆ1Ü�1�t—x‘x‘<Ó ¤# a¨$¯(©(¡lÓ"3Ð3Ð3rcó—y)z’
Whether this writer supports transparency.
Writers may consult output file type and codec to determine this at runtime.
Fr.r&s rÚ_supports_transparencyz*AbstractMovieWriter._supports_transparencyµs€ð rc ó—y)a=
Grab the image information from the figure and save as a movie frame.
All keyword arguments in *savefig_kwargs* are passed on to the
`~.Figure.savefig` call that saves the figure. However, several
keyword arguments that are supported by `~.Figure.savefig` may not be
passed as they are controlled by the MovieWriter:
- *dpi*, *bbox_inches*: These may not be passed because each frame of the
animation much be exactly the same size in pixels.
- *format*: This is controlled by the MovieWriter.
Nr.©r'Úsavefig_kwargss rÚ
grab_framezAbstractMovieWriter.grab_frame½ó�rcó—y)ú,Finish any processing for writing the movie.Nr.r&s rÚfinishzAbstractMovieWriter.finishÌr\rc/ó@K—tjddk(rtjd«|j|||g|¢­i|¤Žtj
ddi«5 |–—|j
« ddd«y#|j
«wxYw#1swYyxYw­w)z•
Context manager to facilitate writing the movie file.
``*args, **kw`` are any parameters that should be passed to `setup`.
ú savefig.bboxÚtightzkDisabling savefig.bbox = 'tight', as it may cause frame size to vary, which is inappropriate for animation.N)rGÚrcParamsÚ_logÚinforRÚ
rc_contextr_)r'rQrPrÚargsÚkwargss rÚsavingzAbstractMovieWriter.savingÐs’èø€ô �<‰<˜Ñ '¨7Ò 2Ü �I‰Ið#ô
$ð
ˆ�
‰
�3˜ Ð6 tÒ6¨vÒ6Ü
�^‰^˜^¨TÐ2Ó
3ñ ð
Ø’
à— ‘ •
÷  ð øð— ‘ •
ú÷  ð üs6‚ABÁBÁA=Á#BÁ4 BÁ=BÂBÂBÂB)éNNNr#)r=r>r?r@r(ÚabcÚabstractmethodrRÚpropertyrUrWr[r_Ú
contextlibÚcontextmanagerrir.rrrBrBsŽ„ñó$Dð  ×Ñòóðð,ñ4óð4ò
ð ×Ññ  óð  ð ×Ññ;óð;ð×ÑñóñrrBcóx‡—eZdZdZdgZ d ˆfd„ Zd„Zd
ˆfd„ Zd„Zd„Z d„Z
d „Z e d
„«Z
e d „«ZˆxZS)Ú MovieWriteraß
Base class for writing movies.
This is a base class for MovieWriter subclasses that write a movie frame
data to a pipe. You cannot instantiate this class directly.
See examples for how to use its subclasses.
Attributes
----------
frame_format : str
The format used in writing frame data, defaults to 'rgba'.
fig : `~matplotlib.figure.Figure`
The figure to capture data from.
This must be provided by the subclasses.
Úrgbacóš•—t|«tur td«‚t‰|�||||¬«|j
d|_||_y)a@
Parameters
----------
fps : int, default: 5
Movie frame rate (per second).
codec : str or None, default: :rc:`animation.codec`
The codec to use.
bitrate : int, default: :rc:`animation.bitrate`
The bitrate of the movie, in kilobits per second. Higher values
means higher quality movies, but increase the file size. A value
of -1 lets the underlying movie encoder select the bitrate.
extra_args : list of str or None, optional
Extra command-line arguments passed to the underlying movie encoder. These
arguments are passed last to the encoder, just before the filename. The
default, None, means to use :rc:`animation.[name-of-encoder]_args` for the
builtin writers.
metadata : dict[str, str], default: {}
A dictionary of keys and values for metadata to include in the
output file. Some keys that may be of use include:
title, artist, genre, subject, copyright, srcform, comment.
zNMovieWriter cannot be instantiated directly. Please use one of its subclasses.)rErFrIrJrN)ÚtyperqÚ TypeErrorÚsuperr(Úsupported_formatsÚ frame_formatÚ
extra_args)r'rErIrJryrFÚ __class__s €rr(zMovieWriter.__init__s\ø€ô. �‹:œÑ $ô
ð%ó&ð
&ô ‰Ñ˜S¨8¸5Ø!(ð ô *à ×2Ñ2°1Ñ5ˆÔØ$ˆ�rcó”—|jdk(ry|jj«\}}t|||jd«\}}||f||fk7rU|jj ||d¬«t jd||||«n|jj«\}}t
jdg|j¢­Ž||fS)NÚh264éT)Úforwardz?figure size in inches has been adjusted from %s x %s to %s x %szframe size in pixels is %s x %s)
rIrQrTrrÚset_size_inchesrdreÚdebugrU)r'ÚwoÚhorrs rÚ_adjust_frame_sizezMovieWriter._adjust_frame_size%s·€Ø �:‰:˜Ò Ø—X‘X×-Ñ-Ó/‰FˆB�Ü# B¨¨D¯H©H°aÓ8‰DˆAˆqØ�Bˆx˜A˜q˜6Ò!Ø—‘×(Ñ(¨¨A°tÐ(Ô<Ü— ‘ ð4Ø57¸¸QÀõCð—8‘8×+Ñ+Ó-‰DˆAˆqÜ �
‰
Ð4ÐG°t·±ÓGØ�!ˆtˆ rcó„•—t‰|�|||¬«|j«\|_|_|j «y©N)r)rvrRrƒÚ_wÚ_hÚ_run©r'rQrPrrzs €rrRzMovieWriter.setup2s7ø€ä
‰‰
�c˜7¨ˆ
Ô,Ø×2Ñ2Ó4шŒ�”ð
� ‰ � rcóÜ—|j«}tjdtj|««t
j }t j||||t¬«|_ y)Nz%MovieWriter._run: running command: %s)ÚstdinÚstdoutÚstderrÚ
creationflags)
Ú_argsrdrer
Ú_pformat_subprocessÚ
subprocessÚPIPEÚPopenÚsubprocess_creation_flagsÚ_proc)r'Úcommandr’s rrˆzMovieWriter._run:sS€ð—*‘*“,ˆÜ � ‰ Ð9Ü×+Ñ+¨GÓ4ô 6ä�‰ˆÜ×%Ñ%Ø ˜4¨°TÜ3ô5ˆ�
rcó¦—|jj«\}}tt|««j «}tt|««j «}|rKt
j
|jjrtjntjd|«|rKt
j
|jjrtjntjd|«|jjr@tj|jj|jj||«‚y)r^zMovieWriter stdout:
%szMovieWriter stderr:
%sN)r•Ú communicaterrÚreadrdÚlogÚ
returncodeÚloggingÚWARNINGÚDEBUGr‘ÚCalledProcessErrorrg)r'ÚoutÚerrs rr_zMovieWriter.finishFsæ€à—:‘:×)Ñ)Ó+‰ˆˆSäœG C›LÓ)×.Ñ.Ó0ˆÜœG C›LÓ)×.Ñ.Ó0ˆÙ Ü �H‰HØ#'§:¡:×#8Ò#8”—’¼g¿m¹mØ)¨3ô
0ñ Ü �H‰HØ#'§:¡:×#8Ò#8”—’¼g¿m¹mØ)¨3ô
0ð �:‰:× Ò Ü×/Ñ/Ø—
‘
×%Ñ% t§z¡z§¡¸¸SóBð
Bð !rc ó4—t|«tjd«|jj |j
|j «|jj|jjf|j|jdœ|¤Žy)Nz'MovieWriter.grab_frame: Grabbing frame.©Úformatr) Ú_validate_grabframe_kwargsrdr€rQrr†r‡Úsavefigr•r‹rxrrYs rr[zMovieWriter.grab_frameXsq€ä" >Ô2Ü �
‰
Ð<Ô=ð
�‰× Ñ  §¡¨$¯'©'Ô2àˆ�‰×јŸ™×)Ñ)ð 9°$×2CÑ2CØ!ŸX™Xñ 9Ø)7ó 9rcó—td«S)z9Assemble list of encoder-specific command-line arguments.z)args needs to be implemented by subclass.©ÚNotImplementedErrorr&s rr�zMovieWriter._argscs€ä"Ð#NÓOÐOrcóN—ttj|j«S)zâ
Return the binary path to the commandline tool used by a specific
subclass. This is a class method so that the tool can be looked for
before making a particular MovieWriter subclass available.
)ÚstrrGrcÚ _exec_key©r3s rÚbin_pathzMovieWriter.bin_pathgs€ô”3—<‘< §
¡
Ñ.Ó/Ð/rcóL—tj|j««duS)z<Return whether a MovieWriter subclass is actually available.N)ÚshutilÚwhichr®r­s rr2zMovieWriter.isAvailableps€ô�|‰|˜CŸL™L›NÓ+°4Ð7Ð7r)rjNNNNr#)r=r>r?r@rwr(rƒrRrˆr_r[r�Ú classmethodr®r2Ú
__classcell__©rzs@rrqrqåsfø„ñð0 ˜ÐàCGØõ#%òJ õò
5òBò$ 9òPðñ0óð0ðñ8óô8rrqcóz‡—eZdZdZˆfd„Zd
d„Zd„Zed„«Zejd„«Zd„Z
d„Z ˆfd „Z ˆxZ
S) ÚFileMovieWriterz}
`MovieWriter` for writing to individual files and stitching at the end.
This must be sub-classed to be useful.
cóT•—t‰|�|i|¤Žtjd|_y)Nzanimation.frame_format)rvr(rGrcrx)r'rgrhrzs €rr(zFileMovieWriter.__init__|s'ø€Ü
‰Ñ˜$Ð) &Ò)ÜŸL™LÐ)AÑBˆÕrcóž—t|«jjd¬«||_||_|€|jj
}||_|j
«|€>t«|_tt|jjd««|_ nd|_||_ d|_ t«|_d|_y)aÓ
Setup for writing the movie file.
Parameters
----------
fig : `~matplotlib.figure.Figure`
The figure to grab the rendered frames from.
outfile : str
The filename of the resulting movie file.
dpi : float, default: ``fig.dpi``
The dpi of the output file. This, with the figure size,
controls the size in pixels of the resulting movie file.
frame_prefix : str, optional
The filename prefix to use for temporary files. If *None* (the
default), files are written to a temporary directory which is
deleted by `finish`; if not *None*, no temporary files are
deleted.
TrLNÚtmprz
%s%%07d.%s)rrNrOrQrPrrƒrÚ_tmpdirr«r,Ú temp_prefixÚ_frame_counterr9Ú _temp_pathsÚfname_format_str)r'rQrPrÚ frame_prefixs rrRzFileMovieWriter.setup€s©€ô(
ˆW‹
×Ñ×$Ñ$¨DÐ$Ô1؈ŒØˆŒ Ø ˆ;Ø—(‘(—,‘,ˆC؈ŒØ ×ÑÔ!à Ð Ü-Ó/ˆDŒLÜ"¤4¨¯ © ×(9Ñ(9¸5Ó#AÓBˆDÕ àˆDŒLØ+ˆDÔ ØˆÔÜ›6ˆÔØ ,ˆÕrcól—t|d«r(|jr|jj«yyy)Nrº)ÚhasattrrºÚcleanupr&s rÚ__del__zFileMovieWriter.__del__¦s*€Ü �4˜Ô #¨¯ ª Ø �L‰L× Ñ Õ "ð)5Ð #rcó—|jS)zƒ
Format (png, jpeg, etc.) to use for saving the frames, which can be
decided by the individual subclasses.
)Ú
_frame_formatr&s rrxzFileMovieWriter.frame_formatªs€ð ×!Ñ!Ð!rc óÖ—||jvr||_ytjd|›dt |«j
›d|jd›d�«|jd|_y)NzIgnoring file format z which is not supported by z; using rz instead.)rwrÅr Ú
warn_externalrtr=)r'rxs rrxzFileMovieWriter.frame_format²sr€à ˜4×1Ñ1Ñ 1Ø!-ˆDÕ ä × Ñ Ø'¨ Ð'7ð8 Ü $ T£
× 3Ñ 3Ð4°HØ×)Ñ)¨!Ñ,Ð-¨Yð8ô
9ð"&×!7Ñ!7¸Ñ!:ˆDÕ rcóL—|j|j|jfzSr#)r¾r»rxr&s rÚ_base_temp_namezFileMovieWriter._base_temp_name½s&€ð×$Ñ$¨×(8Ñ(8¸$×:KÑ:KÐ'LÑLÐLrc ó²—t|«t|j«|jz«}|jj |«|xjdz
c_t jd|j|«t|d«5}|jj|f|j|jdœ|¤Žddd«y#1swYyxYw)Néz8FileMovieWriter.grab_frame: Grabbing frame %d to path=%sÚwbr£)
r¥rrÉr¼r½Úappendrdr€ÚopenrQr¦rxr)r'rZÚpathÚsinks rr[zFileMovieWriter.grab_frameÂs»€ô # >Ô2Ü�D×(Ñ(Ó*¨T×-@Ñ-@Ñ@ÓAˆØ ×Ñ×Ñ Ô%Ø ×Ò˜qÑ ÕÜ �
‰
ÐMØ×&Ñ&¨ô .ä
�$˜Ó
ð / Ø ˆD�H‰H× Ñ ˜Tð
/¨$×*;Ñ*;ÀÇÁñ
/Ø-ò
/÷ /÷ /ñ /ús Â5C
Ã
Ccój•— |j«t‰|� «|jr;tj d|j«|jj
«yy#|jr;tj d|j«|jj
«wwxYw)Nú'MovieWriter: clearing temporary path=%s)rˆrvr_rºrdr€rÂ)r'rzs €rr_zFileMovieWriter.finishÏs‚ø€ð 'Ø �I‰IŒKÜ ‰G‰NÔ à�|Š|Ü—
‘
Ø=¸t¿|¹|ôð— ‘ ×$Ñ$Õ&ð øˆt�|Š|Ü—
‘
Ø=¸t¿|¹|ôð— ‘ ×$Ñ$Õ&ð ús ƒA)Á)A B2©NN)r=r>r?r@r(rRrÃrmrxÚsetterrÉr[r_r³r´s@rr¶r¶vs\ø„ñô
Có$-òL#ðñ"óð"ð×Ññ;óð;òMò
/÷ 'ð 'rr¶ÚpillowcóB‡—eZdZd„Zed„«Zdˆfd„ Zd„Zd„ZˆxZ S)Ú PillowWritercó—y©NTr.r&s rrWz#PillowWriter._supports_transparencyßs€Ørcó—yrÙr.r­s rr2zPillowWriter.isAvailableâó€àrcó8•—t‰|�|||¬«g|_yr…)rvrRÚ_framesr‰s €rrRzPillowWriter.setupæsø€Ü
‰‰
�c˜7¨ˆ
Ô,؈� rc ó®—t|«t«}|jj|fii|¥d|jdœ¥¤Žt j d|j|j«dddd«}|j«dddkr|jj|«y|jj|jd ««y)
Nrrr£ÚRGBAÚrawrrËééÿÚRGB)
r¥rrQr¦rrÚ
frombufferrUÚ getbufferÚ
getextremarÝrÍÚconvert)r'rZÚbufÚims rr[zPillowWriter.grab_frameês³€Ü" >Ô2Ü‹iˆØˆ�‰×ÑØ ñ JØH�nÐH°¸t¿x¹xÒHò Jä
×
Ñ
Ø �D—O‘O S§]¡]£_°e¸VÀQÈóKˆà
�=‰=‹?˜1Ñ ˜aÑ  3Ò &à �L‰L× Ñ  Õ #ð
�L‰L× Ñ  §
¡
¨5Ó 1Õ 2rc ó¤—|jdj|jd|jddtd|jz «d¬«y)NrTrËéè)Úsave_allÚ
append_imagesÚdurationÚloop)rÝÚsaverPrrEr&s rr_zPillowWriter.finishùsE€Ø � ‰ �Q‰×ÑØ �L‰L 4°t·|±|ÀAÀBÐ7Gܘ §¡™Ó)°ð õ 3rr#)
r=r>r?rWr²r2rRr[r_r³r´s@rr×r×Ýs+ø„òðñóðõò
3ö3rr×có.—eZdZdZdZdZd„Zed„«Zy)Ú
FFMpegBasez†
Mixin class for FFMpeg output.
This is a base class for the concrete `FFMpegWriter` and `FFMpegFileWriter`
classes.
zanimation.ffmpeg_pathzanimation.ffmpeg_argscóf—t|j«j}|dvry|jdvS)N¾ú.gifú.apngú.avifú.webmú.webpT>ÚbmpÚdpxÚgifÚpngÚapngÚavrpÚcfhdÚffv1ÚtiffÚv408ÚljpegÚqtrleÚtargaÚproresÚffvhuffÚhuffyuvÚutvideoÚjpeg2000ÚrawvideoÚ prores_awÚ prores_ks)rrPÚsuffixrI©r'rs rrWz!FFMpegBase._supports_transparency s:€Ü�d—l‘lÓ#×*Ñ*ˆØ ÐAÑ AØð �z‰zð>ð>ð >rcó—g}t|j«j}|dvr |dd|_n|j d|jg«|j
� |j
nt j|j}|jdk(rd|vr|j ddg«nM|jdk(rd|vr|j dd g«n&|jd
k(rd|vr|j gd ¢«|jd kDr |j d
d|jzg«|jj«D]\}}|j d|›d|›�g«Œ|j |«|d|jgzS)NrôrËú-vcodecr|ú-pix_fmtÚyuv420prüú-filter_complexz1split [a][b];[a] palettegen [p];[b][p] paletteuseÚavif)rz.split [rgb][rgba]; [rgba] alphaextract [alpha]ú-mapz[rgb]rz[alpha]rz-bz%dkz -metadataú=z-y) rrPrrIÚextendryrGrcÚ _args_keyrJrFÚitems)r'rgrryÚkÚvs rÚ output_argszFFMpegBase.output_argssj€àˆÜ�d—l‘lÓ#×*Ñ*ˆØ ÐAÑ AØ  ˜ˆD�Jà �K‰K˜ D§J¡JÐ/Ô 0Ø)-¯©Ð)D�d—o’oÜŸ<™<¨¯©Ñ7ð ð �:‰:˜Ò  J°jÑ$@Ø �K‰K˜ YÐ/Õ 0ð�Z‰Z˜5Ò
Ð%6¸jÑ%HØ �K‰KÐ*ØLðNõ
Oð�Z‰Z˜6Ò
!Ð&7¸zÑ&IØ �K‰Kò=ô
>ð �<‰<˜!Ò Ø �K‰K˜˜u t§|¡|Ñ3Ð4Ô 5Ø—M‘M×'Ñ'Ó)ò 3‰DˆAˆqØ �K‰K˜¨¨¨1¨Q¨C jÐ1Õ 2ð 3à � ‰ �JÔà�t˜TŸ\™\Ð*Ñ*Ð*rN) r=r>r?r@r¬rrWrmrr.rrròròs,„ñð(€IØ'€Iò >ðñ +óñ +rròÚffmpegcó—eZdZdZd„Zy)Ú FFMpegWriterat
Pipe-based ffmpeg writer.
Frames are streamed directly to ffmpeg via a pipe and written in a single pass.
This effectively works as a slideshow input to ffmpeg with the fps passed as
``-framerate``, so see also `their notes on frame rates`_ for further details.
.. _their notes on frame rates: https://trac.ffmpeg.org/wiki/Slideshow#Framerates
c
ó—|j«dddddd|jzd|jdt|j«g }t
j
«tjkDr|dd gz
}|d
d g|jzz
}|S) Nú-fr rz-sú%dx%drú
-framerateú -loglevelÚerrorú-izpipe:)
r®rUrxr«rErdÚgetEffectiveLevelrœržr©r'rgs rr�zFFMpegWriter._argsKs…€ð—
‘
“  z°9¸jØ�g §¡Ñ/°¸T×=NÑ=NØœc $§(¡(›mð-ˆô × !Ñ !Ó #¤g§m¡mÒ 3Ø �[ 'Ð*Ñ *ˆDØ ��w� $×"2Ñ"2Ñ2Ñ2ˆØˆ rN)r=r>r?r@r�r.rrr!r!?s „ñ ó rr!Ú ffmpeg_filecó—eZdZdZgd¢Zd„Zy)ÚFFMpegFileWriteray
File-based ffmpeg writer.
Frames are written to temporary files on disk and then stitched together at the end.
This effectively works as a slideshow input to ffmpeg with the fps passed as
``-framerate``, so see also `their notes on frame rates`_ for further details.
.. _their notes on frame rates: https://trac.ffmpeg.org/wiki/Slideshow#Framerates
©rýÚjpegrràrrc óŒ—g}|jdvr|dddddd|jzdd gz
}|d
t|j«d |j «gz
}|j
s|d t|j «gz
}tj«tjkDr|d
dgz
}|j«g|¢|j¢S)N>ràrrr#Úimage2rr z -video_sizer$z
-pixel_formatrrr%r(z -frames:vr&r')
rxrUr«rErÉrºr¼rdr)rœržr®rr*s rr�zFFMpegFileWriter._argsis΀ðˆà × Ñ  Ñ /Ø Ø�h  ¨:ؘw¨¯©Ñ8Ø ðñ
ˆDð
�œs 4§8¡8›}¨d°D×4HÑ4HÓ4JÐKÑKˆØ�|Š|Ø �[¤# d×&9Ñ&9Ó":Ð;Ñ ;ˆDô × !Ñ !Ó #¤g§m¡mÒ 3Ø �[ 'Ð*Ñ *ˆDØ—
‘
“Ð: $Ð:¨×)9Ñ)9Ð:Ð:rN)r=r>r?r@rwr�r.rrr-r-[s„ñ ò?Ðó;rr-cóT‡—eZdZdZdZdZd„Zd„Zeˆfd„«Z eˆfd„«Z
ˆxZ S)ÚImageMagickBasea
Mixin class for ImageMagick output.
This is a base class for the concrete `ImageMagickWriter` and
`ImageMagickFileWriter` classes, which define an ``input_names`` attribute
(or property) specifying the input names passed to ImageMagick.
zanimation.convert_pathzanimation.convert_argscóH—t|j«j}|dvS)Nrô)rrPrrs rrWz&ImageMagickBase._supports_transparencyŒs"€Ü�d—l‘lÓ#×*Ñ*ˆØÐEÐEÐErc óZ—|jdk(rdn |j}|j� |jntj|j}|j «dd|j zdddtd|jz «d d
|›d |j›�g
|¢|j‘S) Nràrrz-sizez%ix%iz-depthÚ8z-delayédz-loopÚ0ú:) rxryrGrcrr®rUr«rEÚ input_namesrP)r'Úfmtrys rr�zImageMagickBase._args�s­€à×)Ñ)¨UÒ2‰f¸×8IÑ8IˆØ)-¯©Ð)D�d—o’oÜŸ<™<¨¯©Ñ7ð ð
�M‰M‹OØ �W˜tŸ™Ñ.Ø �cØ ”c˜# §¡™.Ó)Ø �S؈e�1�T×%Ñ%Ð&Ð 'ð

ðð 
ð
�L‰Lð 
ð
rcól•—t‰|�«}|dk(rtjd«j}|S)NrçÚmagick)rvr®rGÚ_get_executable_infoÚ
executable)r3Úbinpathrzs €rr®zImageMagickBase.bin_path s3ø€ä‘'Ñ"Ó$ˆØ �iÒ Ü×.Ñ.¨xÓ8×CÑCˆG؈rcóŽ•— t‰|�«S#tj$r }tj d|«Yd}~yd}~wwxYw)Nz"ImageMagick unavailable due to: %sF)rvr2rGÚExecutableNotFoundErrorrdr€)r3Ú_enfrzs €rr2zImageMagickBase.isAvailable§s>ø€ð Ü‘7Ñ&Ó(Ð (øÜ×*Ñ*ò ä �J‰JÐ;¸TÔ BÜûð úsƒ
‘A¤?¿A) r=r>r?r@r¬rrWr�r²r®r2r³r´s@rr3r3€sGø„ñð)€IØ(€IòFò
ð óóðð óóôrr3Ú imagemagickcó—eZdZdZdZy)ÚImageMagickWriterz‡
Pipe-based animated gif writer.
Frames are streamed directly to ImageMagick via a pipe and written
in a single pass.
ú-N)r=r>r?r@r:r.rrrFrF²s„ñð�KrrFÚimagemagick_filecó*—eZdZdZgd¢Zed„«Zy)ÚImageMagickFileWriterz‡
File-based animated gif writer.
Frames are written to temporary files on disk and then stitched
together at the end.
r.có8—|j›d|j›�S)Nz*.)r»rxr&s rú<lambda>zImageMagickFileWriter.<lambda>Ês€˜×(Ñ(Ð)¨¨D×,=Ñ,=Ð+>Ð?€rN)r=r>r?r@rwrmr:r.rrrJrJ¿s„ñò?ÐÙÙ?óA�KrrJcó2—tj|||¬«S)N)ÚNframesÚ frame_dirrx)r r¤)Ú frame_countrxrOs rÚ_included_framesrQÏs€Ü × !Ñ !¨+Ø,5Ø/;ô =ð=rcóf‡‡—‰dk(rdŠdŠddjˆˆfd„t|«D««zS)z7frame_list should be a list of base64-encoded png filesÚsvgzsvg+xmlz, frames[{0}] = "data:image/{1};base64,{2}"
ú
Úc 3ój•K—|]*\}}‰j|‰|jdd««–—Œ,y­w)rTz\
N)r¤Úreplace)Ú.0ÚiÚ
frame_datarxÚtemplates €€rú <genexpr>z#_embedded_frames.<locals>.<genexpr>Ûs7øèø€ò4á ˆAˆzð �‰˜˜<¨×);Ñ);¸DÀ&Ó)I×Jñ4ùsƒ03)ÚjoinÚ enumerate)Ú
frame_listrxr[s `@rÚ_embedded_framesr`Õs?ù€à�uÒà ˆ Ø>€HØ �"—'‘'ô4ä& zÓ2ô4ó4ñ 4ð4rÚhtmlcó^‡—eZdZdZgd¢Zed„«Z dˆfd„ Zd ˆfd„ Zˆfd„Z d„Z
ˆxZ S)
Ú
HTMLWriterz(Writer for JavaScript-based HTML movies.)rýr/rrScó—yrÙr.r­s rr2zHTMLWriter.isAvailableærÛrc ó<•—|rtjd«d}||_|j«|_t j gd¢|j¬«tj|d«|_ |xjdzc_ t‰ |�-|||||«y)NzHTMLWriter ignores 'extra_args'r.)rïÚonceÚreflect)Ú default_modeúanimation.embed_limité) rdÚwarningÚ embed_framesÚlowerrhr Ú
check_in_listrGrHÚ _bytes_limitrvr()
r'rErIrJryrFrlrhÚ embed_limitrzs
€rr(zHTMLWriter.__init__ês‰ø€ñ Ü �L‰LÐ:Ô ;؈
Ø(ˆÔØ(×.Ñ.Ó0ˆÔÜ ×ÑÒ6Ø(,×(9Ñ(9õ ;ô ŸN™N¨;Ð8OÓPˆÔà ×Ò˜[Ñ(Õä
‰Ñ˜˜e W¨j¸(ÕCrcóL•—t|«}tjddg|j¬«g|_d|_d|_|js9|€|j|jdz«}|jdd¬«|d z }nd}t‰|�1||||«d|_
y)
Nz.htmlz.htm)Úoutfile_extensionrFrÝT)ÚparentsÚexist_okÚframe)rr rnrÚ
_saved_framesÚ _total_bytesÚ
_hit_limitrlÚ with_nameÚstemÚmkdirrvrRÚ _clear_temp)r'rQrPrrOr¿rzs €rrRzHTMLWriter.setupýs�ø€Ü�w“-ˆÜ ×јG VÐ,ÀÇÁÕOàˆÔØˆÔØˆŒà× Ò ØÐ Ø#×-Ñ-¨g¯l©l¸YÑ.FÓG� Ø �O‰O D°4ˆOÔ 8Ø$ wÑ.‰LàˆLä
‰‰
�c˜7 C¨Ô6Ø ˆÕrc óX•—t|«|j�r|jryt«}|jj
|f|j |jdœ|¤Žtj|j««jd«}|xjt|«z
c_ |j|jk\r3tj!d|j|j«d|_y|j"j%|«yt'‰|�Pdi|¤ŽS)Nr£ÚasciizãAnimation size has reached %s bytes, exceeding the limit of %s. If you're sure you want a larger animation embedded, set the animation.embed_limit rc parameter to a larger value (in MB). This and further frames will be dropped.Tr.)r¥rlrxrrQr¦rxrÚbase64Ú encodebytesÚgetvalueÚdecoderwÚlenrordrkrvrÍrvr[)r'rZÚfÚ imgdata64rzs €rr[zHTMLWriter.grab_framesöø€Ü" >Ô2Ø × Ó à�ŠØÜ“ ˆAØ ˆD�H‰H× Ñ ˜Qð
= t×'8Ñ'8Ø!%§¡ñ
=Ø-;ò
=ä×*Ñ*¨1¯:©:«<Ó8×?Ñ?ÀÓHˆIØ × Ò ¤ Y£Ñ /Õ Ø× Ñ  D×$5Ñ$5Ò5Ü— ‘ ðð!%× 1Ñ 1°4×3DÑ3Dô Fð #'�•à×"Ñ"×)Ñ)¨)Õ4ä‘7Ñ%Ñ7¨Ñ7Ð 7rc óX—|jr6t|j|j«}t |j«}nft |j
«}t
||j|j
djj|jj««}tddd¬«}d||jdz<d|jz}t|jd«5}|jtt z«|jt#j$d
t'j(«j*|||dœ|¤Ž«ddd«|j,r;t.j1d |j,«|j,j3«yy#1swYŒQxYw) NrrU)Ú once_checkedÚ loop_checkedÚreflect_checkedÚcheckedÚ_checkedrër)ÚidrNÚ fill_framesÚintervalrÒr.)rlr`rvrxrƒr½rQrNÚ relative_torPr$rhrErÎÚwriter
r rr¤ÚuuidÚuuid4Úhexrºrdr€rÂ)r'r�rPÚ mode_dictrŽÚofs rr_zHTMLWriter.finish(sg€à × Ò Ü*¨4×+=Ñ+=Ø+/×+<Ñ+<ó>ˆKä˜d×0Ñ0Ó1‰Kô˜d×.Ñ.Ó/ˆKÜ*ؘT×.Ñ.Ø× Ñ  Ñ#×*Ñ*×6Ñ6°t·|±|×7JÑ7JÓKóMˆKô bØ&(Ø)+ô-ˆ ð5>ˆ �$×#Ñ# jÑ0Ñ1à˜4Ÿ8™8Ñ#ˆä
�$—,‘, Ó
$ð ;¨Ø �H‰H”Z¤-Ñ/Ô 0Ø �H‰HÔ%×,Ñ,ð:´·
±
³ ×0@Ñ0@Ø5@Ø9DØ6>ñ:ð09ñ :ô
;÷ ;ð �<Š<Ü �J‰JÐ@À$Ç,Á,Ô OØ �L‰L× Ñ Õ "ð ÷ ;ð ;ús
Ã.A"F Æ F))éNNNNFrïNrÓ) r=r>r?r@rwr²r2r(rRr[r_r³r´s@rrcrcàs@ø„á2â6ÐàñóððEIØAGØ!õDõ&!ô&8ö0"#rrccó®—eZdZdZdd„Zd„Zd„Zd„Z dddœd„Zd „Z d
„Z
d „Z d „Z d
„Z
d„Zd„Zd„Zd„Zd„Zd„Zd„Zd„Zdd„Zdd„Zd„Zd„Zd„Zy)Ú AnimationaÚ
A base class for Animations.
This class is not usable as is, and should be subclassed to provide needed
behavior.
.. note::
You must store the created Animation in a variable that lives as long
as the animation should run. Otherwise, the Animation object will be
garbage-collected and the animation stops.
Parameters
----------
fig : `~matplotlib.figure.Figure`
The figure object used to get needed events, such as draw or resize.
event_source : object, optional
A class that can run a callback when desired events
are generated, as well as be stopped and started.
Examples include timers (see `TimedAnimation`) and file
system notifications.
blit : bool, default: False
Whether blitting is used to optimize drawing. If the backend does not
support blitting, then this parameter has no effect.
See Also
--------
FuncAnimation, ArtistAnimation
Ncó�—d|_||_|xr|jj|_|j «|_||_|jjd|j«|_
|jjjd|j«|_ |jr|j«yy)NFÚ
draw_eventÚ close_event)Ú_draw_was_startedÚ_figÚcanvasÚ
supports_blitÚ_blitÚ
new_frame_seqÚ frame_seqÚ event_sourceÚ mpl_connectÚ_startÚ_first_draw_idÚ_stopÚ _close_idÚ _setup_blit)r'rQr£Úblits rr(zAnimation.__init__os¢€Ø!&ˆÔàˆŒ ðÒ6˜cŸj™j×6Ñ6ˆŒ
ð ×+Ñ+Ó-ˆŒØ(ˆÔð"Ÿj™j×4Ñ4°\À4Ç;Á;ÓOˆÔðŸ™×)Ñ)×5Ñ5°mØ6:·j±jóBˆŒà �:Š:Ø × Ñ Õ ð rcóJ—t|dd«stjd«yy)NrœTzéAnimation was deleted without rendering anything. This is most likely not intended. To prevent deletion, assign the Animation to a variable, e.g. `anim`, that exists until you output the Animation using `plt.show()` or `anim.save()`.)ÚgetattrÚwarningsÚwarnr&s rrÃzAnimation.__del__Šs%€Ü�tÐ0°$Ô7Ü �M‰Mð!õ
ð8rcóJ—|jjj«ry|jjj|j«|j «|j j|j«|j j«y)z‹
Starts interactive animation. Adds the draw frame command to the GUI
handler, calls show to start the event loop.
N)
r�ržÚ is_savingÚmpl_disconnectr¦Ú
_init_drawr£Ú add_callbackÚ_stepÚstartr*s rr¥zAnimation._start”ss€ð �9‰9× Ñ × %Ñ %Ô 'Ø à � ‰ ×Ñ×'Ñ'¨×(;Ñ(;Ô<ð
�‰Ôð
×Ñ×&Ñ& t§z¡zÔ2Ø ×Ñ×ÑÕ!rcó0—|jr/|jjj|j«|jjj|j
«|j j|j«d|_yr#) r r�ržr±Ú
_resize_idr¨r£Úremove_callbackr´r*s rr§zAnimation._stop§sa€à �:Š:Ø �I‰I× Ñ × +Ñ +¨D¯O©OÔ <Ø � ‰ ×Ñ×'Ñ'¨¯©Ô7Ø ×Ñ×)Ñ)¨$¯*©*Ô5Ø ˆÕr)Úprogress_callbackc 
óN‡—‰g} | �| jˆfd„| D««| D] }
d|
_Œ |€tjd}n2t |t
«s"t
d„|||||fD««r td«‚|
€i}
n t|
«}
|€t‰d«rd‰jz }tj|d «}|d
k(r‰jj}i}|�||d <|�||d <|�||d
<|�||d<t |t
«r t|}||fi|¤Ž}t j%dt'|««d|
vr&t j#d«|
j)d«d„}|j+‰j||«5t-j.‰jj0dd¬«5|j3«sR|
j5dtjd«}|dk(r‰jj7«}||«|
d<d|
d<| D]}
|
j9«Œd}| D�cgc]}t;|dd«‘Œ}}d|vrd}n t=|«}t?| D�cgc]}|jA«‘Œc}ŽD]L}t?| |«D])\}
}|
jC|d¬«| €Œ| ||«|dz
}Œ+|jDdi|
¤ŽŒN ddd«ddd«y#t$r t}t j#d|«Y�ŒôwxYwcc}wcc}w#1swYŒHxYw#1swYyxYw)aj
Save the animation as a movie file by drawing every frame.
Parameters
----------
filename : str
The output filename, e.g., :file:`mymovie.mp4`.
writer : `AbstractMovieWriter` subclass or str, default: :rc:`animation.writer`
The writer used to grab the frames and create the movie file.
This can be an instance of an `AbstractMovieWriter` subclass or a
string. The builtin writers are
================== ==============================
str class
================== ==============================
'ffmpeg' `.FFMpegWriter`
'ffmpeg_file' `.FFMpegFileWriter`
'imagemagick' `.ImageMagickWriter`
'imagemagick_file' `.ImageMagickFileWriter`
'pillow' `.PillowWriter`
'html' `.HTMLWriter`
================== ==============================
fps : int, optional
Movie frame rate (per second). If not set, the frame rate from the
animation's frame interval.
dpi : float, default: :rc:`savefig.dpi`
Controls the dots per inch for the movie frames. Together with
the figure's size in inches, this controls the size of the movie.
codec : str, default: :rc:`animation.codec`.
The video codec to use. Not all codecs are supported by a given
`MovieWriter`.
bitrate : int, default: :rc:`animation.bitrate`
The bitrate of the movie, in kilobits per second. Higher values
means higher quality movies, but increase the file size. A value
of -1 lets the underlying movie encoder select the bitrate.
extra_args : list of str or None, optional
Extra command-line arguments passed to the underlying movie encoder. These
arguments are passed last to the encoder, just before the output filename.
The default, None, means to use :rc:`animation.[name-of-encoder]_args` for
the builtin writers.
metadata : dict[str, str], default: {}
Dictionary of keys and values for metadata to include in
the output file. Some keys that may be of use include:
title, artist, genre, subject, copyright, srcform, comment.
extra_anim : list, default: []
Additional `Animation` objects that should be included
in the saved movie file. These need to be from the same
`.Figure` instance. Also, animation frames will
just be simply combined, so there should be a 1:1 correspondence
between the frames from the different animations.
savefig_kwargs : dict, default: {}
Keyword arguments passed to each `~.Figure.savefig` call used to
save the individual frames.
progress_callback : function, optional
A callback function that will be called for every frame to notify
the saving progress. It must have the signature ::
def func(current_frame: int, total_frames: int) -> Any
where *current_frame* is the current frame number and *total_frames* is the
total number of frames to be saved. *total_frames* is set to None, if the
total number of frames cannot be determined. Return values may exist but are
ignored.
Example code to write the progress to stdout::
progress_callback = lambda i, n: print(f'Saving frame {i}/{n}')
Notes
-----
*fps*, *codec*, *bitrate*, *extra_args* and *metadata* are used to
construct a `.MovieWriter` instance and can only be passed if
*writer* is a string. If they are passed as non-*None* and *writer*
is a `.MovieWriter`, a `RuntimeError` will be raised.
Nc3óR•K—|]}|j‰jur|–—Œ y­wr#)r�)rXÚanimr's €rr\z!Animation.save.<locals>.<genexpr>
s(øèø€ò7 TØ#Ÿy™y¨D¯I©IÑ5ô!ñ7ùsƒ$'Túanimation.writerc3ó$K—|]}|du–—Œ
y­wr#r.)rXÚargs rr\z!Animation.save.<locals>.<genexpr>sèø€òJØð˜T”/ñJùs‚zâPassing in values for arguments fps, codec, bitrate, extra_args, or metadata is not supported when writer is an existing MovieWriter instance. These should instead be passed as arguments when creating the MovieWriter instance.Ú _intervalç@�@z savefig.dpiÚfigurerIrJryrFz1MovieWriter %s unavailable; using Pillow instead.zAnimation.save using %sÚ bbox_incheszŒWarning: discarding the 'bbox_inches' argument in 'savefig_kwargs' as it may cause frame size to vary, which is inappropriate for animation.cóx—tj|«\}}}}|tj|||g«zdz|z
S)NrË)ÚmcolorsÚto_rgbarÚarray)ÚcolorÚrÚgÚbÚas rÚ_pre_composite_to_whitez/Animation.save.<locals>._pre_composite_to_whiteOs<€Ü Ÿ™¨Ó/‰JˆAˆq�!�QØ”r—x‘x  A q  Ó*Ñ*¨QÑ.°Ñ2Ð 2r)Ú
_is_savingÚmanagerÚ facecolorzsavefig.facecolorÚautoFÚ transparentrÚ _save_count)rªrËr.)#rrœrGrcÚ
isinstancer«Úanyr;r$rÁrÀrHr�rÚwritersr×rdrkrertÚpoprir
Ú _setattr_cmržrWÚgetÚ
get_facecolorr²r¬ÚsumÚzipÚnew_saved_frame_seqÚ_draw_next_framer[)r'ÚfilenameÚwriterrErrIrJryrFÚ
extra_animrZr¹Úall_animr¼Ú
writer_kwargsr+rÍrÐÚ frame_numberrÌÚsave_count_listÚ total_framesÚdataÚds` rrðzAnimation.save¯s}ø€ðr�6ˆØ Ð !Ø �O‰Oó7¨Zô7ô
7ðò *ˆDØ%)ˆDÕ "ð *ð ˆ>Ü—\‘\Ð"4Ñ5‰FܘV¤SÔ)ÜñJØ! 5¨'°:¸xÐHôJôJäð 7ó8ð
8ð Ð !؉Nô" .Ó1ˆNà ˆ;œ7 4¨Ô5à˜$Ÿ.™.Ñ(ˆCô�n‰n˜S -Ó0ˆØ �(Š?Ø—)‘)—-‘-ˆCàˆ
Ø Ð Ø%*ˆM˜'Ñ "Ø Ð Ø'.ˆM˜)Ñ $Ø Ð !Ø*4ˆM˜,Ñ 'Ø Ð Ø(0ˆM˜*Ñ %ô �fœcÔ "ð
1Ü$ V™_�
ñ
  Ñ5 }Ñ5ˆFÜ � ‰ Ð+¬T°&«\Ô:à ˜NÑ *Ü �L‰LðJô
Kð
× Ñ ˜}Ô -ò 3ð�m‰m˜DŸI™I x°Ó5ñ 4Ü×Ñ § ¡ × 0Ñ 0¸TÈ4ÔPñ 4à×0Ñ0Ô2Ø*×.Ñ.¨{Ü/2¯|©|Ð<OÑ/PóR� à Ò&Ø $§ ¡ × 7Ñ 7Ó 9�IÙ.EÀiÓ.P�˜{Ñ+Ø05�˜}Ñ-à ò
"�Ø—‘Õ!ð
"àˆLð)1ö2Ø#$ô ' q¨-¸Õ>ð2ˆOð2à�Ñ&Ø#‘ ä" ?Ó3� ܸxÖH¸!˜a×3Ñ3Õ5ÒHÐIò
4�Ü" 8¨TÓ2ò*‘G�D˜!à×)Ñ)¨!°%Ð)Ô8Ø(Ñ4Ù)¨,¸ ÔEØ$¨Ñ)™ ð *ð "�×!Ñ!Ñ3 NÓ3ñ
4÷+ 4÷ 4ð 4øô7 ò
1Ü)�
Ü— ‘ ð(Ø)/÷1ð
1üòT2ùò I÷+ 4ð 4ú÷ 4ð 4ús[Ä KÅ?-LÆ,BLÈ,LÉLÉL
É4.LÊ#$LËLË%LÌLÌ
LÌL ÌLÌL$có†— t|j«}|j||j«y#t$rYywxYw)z‰
Handler for getting events. By default, gets the next frame in the
sequence and hands the data off to be drawn.
TF)Únextr¢rÞr Ú
StopIteration)r'rgÚ framedatas rr´zAnimation._stepts>€ð ܘTŸ^™^Ó,ˆIØ × !Ñ ! )¨T¯Z©ZÔ 8ØøÜò Ùð ús‚14´ A¿Acó,—t|j«S)z+Return a new sequence of frame information.)ÚiterÚ
_framedatar&s rr¡zAnimation.new_frame_seqƒs€ô�D—O‘OÓ$Ð$rcó"—|j«S)z8Return a new sequence of saved/cached frame information.)r¡r&s rrÝzAnimation.new_saved_frame_seqˆs€ð×!Ñ!Ó#Ð#rcón—|j||«|j|«|j||«yr#)Ú _pre_drawÚ _draw_frameÚ
_post_draw©r'rìrªs rrÞzAnimation._draw_next_frame�s.€ð
�‰�y $Ô'Ø ×јÔ#Ø �‰˜  4Õ(rcó—d|_yrÙ)rœr&s rr²zAnimation._init_draw”s €ð"&ˆÕrcó@—|r|j|j«yyr#)Ú _blit_clearÚ_drawn_artistsrõs rròzAnimation._pre_draw™s €ñ Ø × Ñ ˜T×0Ñ0Õ 1ð rcó—td«‚)NzDNeeds to be implemented by subclasses to actually make an animation.r¨)r'rìs rrózAnimation._draw_frameŸs€ä!ð#AóBð Brcó —|r(|jr|j|j«y|jjj «yr#)rùÚ
_blit_drawr�ržÚ draw_idlerõs rrôzAnimation._post_draw¤s7€ñ �D×'Ò'Ø �O‰O˜D×/Ñ/Õ 0à �I‰I× Ñ × &Ñ &Õ (rcóø—|D�chc]}|j’Œ}}|D]}|j«}|jj|t «df«\}}||k7sŒB||j
j j|j«f|j|<Œ�|D]}|jj|«Œ|D]1}|j
j j|j«Œ3ycc}wr#) ÚaxesÚ _get_viewÚ _blit_cacherÙÚobjectrÂržÚcopy_from_bboxÚbboxÚ draw_artistrª)r'ÚartistsrÌÚ
updated_axÚaxÚcur_viewÚviewÚbgs rrüzAnimation._blit_draw®sì€ð'.Ö. �a—f“fÐ.ˆ
Ð.ðò HˆBð—|‘|“~ˆHØ×'Ñ'×+Ñ+¨B´³¸4Ð0@ÓA‰HˆD�"ؘ4Óà˜bŸi™i×.Ñ.×=Ñ=¸b¿g¹gÓFð(H�× Ñ  Ò$ð Hðò "ˆAØ
�F‰F× Ñ ˜qÕ !ð "ðò +ˆBØ �I‰I× Ñ × !Ñ ! "§'¡'Õ *ñ +ùò!/s…C7có:—|D�chc]}|j’Œ}}|D]i} |j|\}}|j«|k(r&|jj
j
|«ŒO|jj|«Œkycc}w#t$rYŒ}wxYwr#)rÿrr1rrÂržÚrestore_regionr×)r'rrÌrÿrr
r s rrøzAnimation._blit_clearÄs˜€ð!(Ö(˜1�—“Ð(ˆÐ(Øò )ˆBð
Ø×+Ñ+¨BÑ/‘��bð�|‰|‹~ Ò%Ø— ‘ × Ñ ×/Ñ/°Õ3à× Ñ ×$Ñ$ RÕ(ñ )ùò)øôò
Ùð
ús…B  BÂ BÂBcóò—t«|_g|_|jd|j«|j «|j jjd|j«|_
y)NÚ resize_event) r$rrùrôr r²r�ržr¤Ú
_on_resizer·r&s rr©zAnimation._setup_blitÓsX€ä›6ˆÔØ ˆÔà �‰˜˜dŸj™jÔ)ð
�‰ÔàŸ)™)×*Ñ*×6Ñ6°~Ø7;·±óHˆ�rcóT—|jjj|j«|jj «|j j«|j«|jjjd|j«|_y)Nrš) r�ržr±r·r£ÚstoprÚclearr²r¤Ú _end_redraw©r'Úevents rrzAnimation._on_resizeâsv€ð
� ‰ ×Ñ×'Ñ'¨¯©Ô8Ø ×Ñ×ÑÔ Ø ×Ñ×ÑÔ Ø �‰ÔØŸ)™)×*Ñ*×6Ñ6°|Ø7;×7GÑ7GóIˆ�rcó$—|jdd«|jj«|jjj |j «|jjjd|j«|_y)NFr) rôr£rµr�ržr±r·r¤rrs rrzAnimation._end_redrawîsf€ð
�‰˜˜eÔ$Ø ×Ñ×ÑÔ!Ø � ‰ ×Ñ×'Ñ'¨¯©Ô8ØŸ)™)×*Ñ*×6Ñ6°~Ø7;·±óHˆ�rcó4—d}t|d«�stj|d«}|dz}t«5}t |d«}t
tj d}|dtj dd |jz ¬
«}|jt|«|¬ «tj|j««}d d d «t«}||k\rtjd
||«n4|j!d«|_dj$j&Ž|_t|d«rYddg} t+|dd«r| j-d«|j%|j"|j(dj/| «¬«Sy#1swYŒËxYw)a‚
Convert the animation to an HTML5 ``<video>`` tag.
This saves the animation as an h264 video, encoded in base64
directly into the HTML5 video tag. This respects :rc:`animation.writer`
and :rc:`animation.bitrate`. This also makes use of the
*interval* to control the speed, and uses the *repeat*
parameter to decide whether to loop.
Parameters
----------
embed_limit : float, optional
Limit, in MB, of the returned animation. No animation is created
if the limit is exceeded.
Defaults to :rc:`animation.embed_limit` = 20.0.
Returns
-------
str
An HTML5 video tag with the animation embedded as base64 encoded
h264 video.
If the *embed_limit* is exceeded, this returns the string
"Video too large to embed."
z�<video {size} {options}>
<source type="video/mp4" src="data:video/mp4;base64,{video}">
Your browser does not support the video tag.
</video>Ú
_base64_videorirjztemp.m4vr½r|rDrÁ)rIrJrE©ràNz±Animation movie is %s bytes, exceeding the limit of %s. If you're sure you want a large animation embedded, set the animation.embed_limit rc parameter to a larger value (in MB).r~zwidth="{}" height="{}"ÚcontrolsÚautoplayÚ_repeatFrïú )ÚvideoÚsizeÚoptionszVideo too large to embed.)rÁrGrHrrrÖrcrÀrðr«rr€Ú
read_bytesrƒrdrkr‚rr¤rUÚ _video_sizer¬rÍr])
r'rpÚ VIDEO_TAGÚtmpdirrÏÚWriterràÚvid64Úvid_lenr!s
rÚto_html5_videozAnimation.to_html5_video÷s�€ð2 ˆ ô
�t˜_Õ-äŸ.™.¨Ð6MÓNˆKð
˜;Ñ &ˆKô$Ó%ð
>¨Ü˜F JÓ/�ô!¤§¡Ð.@Ñ!AÑB�Ù fÜ(+¯ © Ð5HÑ(IØ$)¨D¯N©NÑ$:ô<�ð— ‘ œ#˜d›)¨F� Ô3ä×*Ñ*¨4¯?©?Ó+<Ó=�÷
>ô˜%“jˆGؘ+Ò%Ü— ‘ ðð!(¨õ 6ð &+§\¡\°'Ó%:�Ô"Ø#BÐ#;×#BÑ#BØ×*Ñ*ð$,�Ô ô �4˜Ô )à! :Ð.ˆGô�t˜Y¨Ô.Ø—‘˜vÔ&à×#Ñ#¨$×*<Ñ*<Ø)-×)9Ñ)9Ø,/¯H©H°WÓ,=ð$ó?ð
?ð/÷K
>ð
>ús µBFÆFcó”—|€t|d«rd|jz }|€t|dd«rdnd}t|d«sjt«5}t |d «}t |||¬
«}|j
t|«|¬ «|j«|_ ddd«|jS|jS#1swY|jSxYw) a¶
Generate HTML representation of the animation.
Parameters
----------
fps : int, optional
Movie frame rate (per second). If not set, the frame rate from
the animation's frame interval.
embed_frames : bool, optional
default_mode : str, optional
What to do when the animation ends. Must be one of ``{'loop',
'once', 'reflect'}``. Defaults to ``'loop'`` if the *repeat*
parameter is True, otherwise ``'once'``.
Returns
-------
str
An HTML representation of the animation embedded as a js object as
produced with the `.HTMLWriter`.
NrÀrërFrïrfÚ_html_representationz temp.html)rErlrhr)
rÁrÀr¬rrrcrðr«Ú read_textr+)r'rErlrhr%rÏràs rÚ to_jshtmlzAnimation.to_jshtmlEsÒ€ð* ˆ;œ7 4¨Ô5à˜Ÿ™Ñ'ˆCð Ð Ü%,¨T°9Ø-2ô&4™6Ø9?ð
ô�tÐ3Ô4ô$Ó%ð
=¨Ü˜F KÓ0�Ü#¨Ø1=Ø1=ô?�ð— ‘ œ#˜d›)¨F� Ô3Ø,0¯N©NÓ,<�Ô)÷

=ð×(Ñ(Ð(ˆt×(Ñ(Ð(÷
=ð×(Ñ(Ð(ús
ÁA B3Â3Ccó~—tjd}|dk(r|j«S|dk(r|j«Sy)z#IPython display hook for rendering.zanimation.htmlÚhtml5ÚjshtmlN)rGrcr)r-)r'r;s rÚ _repr_html_zAnimation._repr_html_qs@€ä�l‰lÐ+Ñ,ˆØ �'Š>Ø×&Ñ&Ó(Ð (Ø
�HŠ_Ø—>‘>Ó#Ð #ðrcó–—|jj«|jr#|jD]}|j d«Œyy)zPause the animation.FN)r£rr rùÚ set_animated©r'Úartists rÚpausezAnimation.pauseysC€à ×Ñ×ÑÔ Ø �:Š:Ø×-Ñ-ò
+�Ø×#Ñ# EÕ*ñ
+ð rcó–—|jj«|jr#|jD]}|j d«Œyy)zResume the animation.TN)r£rµr rùr3r4s rÚresumezAnimation.resume€sC€à ×Ñ×ÑÔ!Ø �:Š:Ø×-Ñ-ò
*�Ø×#Ñ# DÕ)ñ
*ð r©NF) NNNNNNNNNr#)NTN)r=r>r?r@r(rÃr¥r§rðr´r¡rÝrÞr²ròrórôrürør©rrr)r-r1r6r8r.rrr˜r˜Msš„ñóBò6ò"ò&!ðEIØFJØ ðC4à7;ôC4òJ
ò%ò
$ò
)ò&ò
2ò Bò
)ò+ò,
)ò
Hò
IòHóL/ó\*)òX$ò+ó*rr˜có2‡—eZdZdZ dˆfd„ Zˆfd„ZˆxZS)ÚTimedAnimationa}
`Animation` subclass for time-based animation.
A new frame is drawn every *interval* milliseconds.
.. note::
You must store the created Animation in a variable that lives as long
as the animation should run. Otherwise, the Animation object will be
garbage-collected and the animation stops.
Parameters
----------
fig : `~matplotlib.figure.Figure`
The figure object used to get needed events, such as draw or resize.
interval : int, default: 200
Delay between frames in milliseconds.
repeat_delay : int, default: 0
The delay in milliseconds between consecutive animation runs, if
*repeat* is True.