rL i.ddlZddlZddlZddlmZddlZddlZddlZddlZddl Z ddl Z ddl m Z ddl Z ddlmZddlZddlmZmZddlmZmZmZmZddlmZddlmZmZdd lm Z dd l!m"Z"dd l#m$Z$dd l%m&Z&ejNe(Z)d Z*dZ+dZ,de,z Z-dZ.de.z Z/dZ0dZ1dZ2dZ3dZ4Gdde5Z6GddZ7ejpddZ9GddeZ:Gdd eZ;eZGd#d$Z?y)%N)BytesIO)TemporaryDirectory)Image)cbook font_manager)_BackendFigureCanvasBaseFigureManagerBase RendererBase)MixedModeRenderer)_create_pdf_info_dict_datetime_to_pdf)Path)Figure)FontProperties)Gcfz\documentclass{article}cZttjdj}dj dddd|zdd |d |zfzd d tjd g tjdrddgt gddDcgc]*}t jtj|,c}Dcgc]3\}}d|d|jd|jjd5c}}zdgzngtjjddScc}wcc}}w)z=Prepare a LaTeX preamble based on the rcParams configuration.z font.size)size z\def\mathdefault#1{#1}z4\everymath=\expandafter{\the\everymath\displaystyle}z\IfFileExists{scrextend.sty}{z' \usepackage[fontsize=%fpt]{scrextend}z}{z: \renewcommand{\normalsize}{\fontsize{%f}{%f}\selectfont}333333?z \normalsize}z pgf.preamble pgf.rcfontsz1\ifdefined\pdftexversion\else % non-pdftex case.z \usepackage{fontspec}) setmainfont setsansfont setmonofont)serifz sans\-serif monospacez \{z}[Path=\detokenize{z/}]z\fi underscorestrings)option)rmplrcParamsget_size_in_pointsjoinzippathlibrfmfindfontnameparentas_posix texmanager_usepackage_if_not_loaded) font_size_ptfamilycommandpaths e/mnt/ssd/data/python-lab/Trading/venv/lib/python3.12/site-packages/matplotlib/backends/backend_pgf.py _get_preambler4'sG! \\+ & 99 "? )2\A E |+ , -  ^$%!< ]3 A & "%=EGbkk&12G"  4;;#7#7#9 ;  H :<=!@ 00i0PA!! !6G  s ?/D"88D'gRhV??gqq?c&|jddS)zh Do some necessary and/or useful substitutions for texts to be included in LaTeX documents. u−z\ensuremath{-})replace)texts r3 _tex_escaper9Xs <<(*; <<cH|j||jdy)Nz% )write)fhlines r3_writelnr?`sHHTNHHUOr:cg}ddddd}|jd|vr|j|n|tjds|jdnWt fdt j jDr|jd zntjd |j}|jd ||d zfzd ddd}|j||jgd}|j|vr|jd|jddd j|zdzdzt|zdzS)z Generate a TeX string that renders string *s* with font properties *prop*, also applying any required escapes to *s*. z \rmfamilyz \sffamilyz \ttfamily)rsansz sans-serifrrrz\fontfamily{\familydefault}c3<K|]}|jk(ywN)r*).0fontr0s r3 z*_escape_and_apply_props..us DTTYY& Dsz9\ifdefined\pdftexversion\else\setmainfont{%s}\rmfamily\fizIgnoring unknown font: %sz\fontsize{%f}{%f}rz\itshapez\slshape)normalitalicoblique)semibolddemibolddemiboldheavyz extra boldblackz \bfseriesz \selectfontrz1\catcode`\^=\active\def^{\ifmmode\sp\else\^{}\fi}z\catcode`\%=\active\def%{\%}r) get_familyappendr"r#anyr( fontManagerttflist_logwarningr$ get_style get_weightr%r9)spropcommandsfamiliesrstyles boldstylesr0s @r3_escape_and_apply_propsr`gs[ H%|*GH __ q !F () \\- (67 DR^^-C-C D D H6 Q S 0&9  " " $D OO(D$*+==>{{ KF OOF4>>+,-)J J& % OON# ''(   > ? *  * a.    r:ct|tjr t|}n,|dk(r|jj d}n t |}|d|dS)z;Convert metadata key/value to a form that hyperref accepts.Trappedasciiz={r) isinstancedatetimerr*decodestr)keyvalues r3_metadata_to_strrjsT%**+ '  !!'*E U#eWB r:c tjddS#tj$rYnwxYw tjdfdS#tj$r YtdwxYw)z9Return a function that converts a pdf file to a png file. pdftocairoc tjdddddd|z|tjj |dgtj S) Nrlz -singlefilez-transpz-pngz-rz%drstderr) subprocess check_outputosr2splitextSTDOUT)pdffilepngfiledpis r3z+make_pdf_to_png_converter..sIZ-D-D =)VT4#: bgg&&w/2 4$$.&r:gsctjjddddddddd d d |zd |z|gtj S)Nz-dQUIETz-dSAFERz-dBATCHz -dNOPAUSEz -dNOPROMPTz -dUseCIEColorz-dTextAlphaBits=4z-dGraphicsAlphaBits=4z-dDOINTERPOLATEz-sDEVICE=pngalphaz-sOutputFile=%sz-r%drn)rprq executablert)rurvrwgs_infos r3rxz+make_pdf_to_png_converter..sVZ-D-D     9k< 1 $&7 "3g"= c\7  $ $$.&r:z&No suitable pdf to png renderer found.)r"_get_executable_infoExecutableNotFoundError RuntimeError)r|s@r3make_pdf_to_png_converterrs&   .& &  & &    &**40& &  & &   ? @@ s11AA/.A/c&eZdZdfd ZdZxZS) LatexErrorc2t||||_yrC)super__init__ latex_output)selfmessager __class__s r3rzLatexError.__init__s !(r:c^|j\}|jr|d|jzz }|SNr)argsrrrZs r3__str__zLatexError.__str__s0 YY    ))) )Ar:)rG)__name__ __module__ __qualname__rr __classcell__rs@r3rrs )r:rceZdZdZedZedZeejddZ dZ dZ dZ d Zd d d Zd ZdZy) LatexManagerz The LatexManager opens an instance of the LaTeX application for determining the metrics of text elements. The LaTeX environment can be modified by setting fonts and/or a custom preamble in `.rcParams`. cttdtjddtddg}dj |S)Nz% !TeX program = pgf.texsystemz\usepackage{graphicx}\begin{document}z!\typeout{pgf_backend_query_start}r)_DOCUMENTCLASSr"r#r4r%) latex_headers r3_build_latex_headerz LatexManager._build_latex_headersC !o!> ? @ $ O  0  yy&&r:c@|j|jS)z Return the previous LatexManager if the header and tex system did not change, or a new instance otherwise. )_get_cached_or_new_implr)clss r3_get_cached_or_newzLatexManager._get_cached_or_news **3+B+B+DEEr:c|SrC)rheaders r3rz$LatexManager._get_cached_or_new_impls u r:c|j|j|jjj||jjjd|jjj yr)latex_setup_latex_processstdinr<flushrs r3_stdin_writelnzLatexManager._stdin_writelns^ ::   % % ' q! t$  r:cPt|}g} |jjjd}|j ||t | d|k(rn?|s<|jj d|_tddj|dj|S)NrzLaTeX process haltedrG) listrstdoutreadrRlenkillrr%)rrZcharscs r3_expectzLatexManager._expects G !!&&q)A LLOc!fWX!# !!  !7HHwwu~r:c$|jdS)Nz *)rrs r3_expect_promptzLatexManager._expect_prompts||E""r:ct|_|jj|_t j ||jj |_|jd|jjd\}}|jjdk7rtd|j|d|_ tj|j |_y)NF expect_replyz \makeatletter\@@end rzaLaTeX errored (probably missing font or error in preamble) while processing the following input: )r_tmpdirr*tmpdirweakreffinalizecleanup_finalize_tmpdirrr communicate returncoderr functools lru_cache_get_box_metrics)rrros r3rzLatexManager.__init__s)+ ll'' ' 0 0t||7K7K L !!u!5//0KL :: A %:++-.0    ) 3 3D4I4I Jr:TrcH tjtjddgtjtjd|j |_d}tj|||j |_ |j|j|r"|jd|j!yy#t$r%}ttjdd|d}~wt$r%}tdtjd|d}~wwxYw) Nr-halt-on-errorutf-8)rrencodingcwdz] not found; install it or change rcParams['pgf.texsystem'] to an available TeX implementationzError starting c|j |jy#t$r|jYywxYwrC)rrrwait)rs r3finalize_latexz9LatexManager._setup_latex_process..finalize_latex(s4 JJL !!#   s #??z*pgf_backend_query_start)rpPopenr"r#PIPErrFileNotFoundErrorrOSErrorrr_finalize_latexrrrr)rrerrrs r3rz!LatexManager._setup_latex_processs N#))o.0@A oojoo dkk3DJ  '// .$** . D4467  LL3 4    ! )! <<034OP  N!#,,"?!BCEJM N Ns$AC D! C00 D!< DD!c8|jt||S)z Get the width, total height, and descent (in TeX points) for a text typeset by the current LaTeX environment. )rr`)rr8r[s r3get_width_height_descentz%LatexManager.get_width_height_descent7s $$%s   5    F((*F  <%+$5$5$7$;$A$A#$F !E66cr #U6#2;%7vcr{9Ka1!a%{ FD$fS#*:*:;=BE F F <D$fS&138; < TWW1 2  ' 'G 4   $  T9g > TWW2 3 TWWF G TWW1 2 TWWE F TWW2 3NN++-33DHH=E  r'8'8':E B   t  , TWW/ 0 TWWd #TXX A  +668 'LT4,4T1t8$DT1t8$D4$;/4$;1G$D TWW:dD\I KDk G+KBTWW&LMTWW&IJK"G$"NO"EF  G TWW/ 0O r:cd|jz }|j}|rb|j\}}||z \}}|d|z|d|z||z||zf}t|jd|zt|jd|j \} } | *|j || | t|jdyy)Nr5rrzA\pgfpathrectangle{\pgfqpoint{%fin}{%fin}}{\pgfqpoint{%fin}{%fin}}r)rwget_clip_rectanglerr?r= get_clip_pathr) rrr bboxp1p2rrrclippathclippath_transs r3rzRendererPgf._print_pgf_clips M$$& __&FB7DAqUQY1 1q5!a%7F TWWI  TWW2 3$#3#5 .    X~ > TWW2 3 r:c dddd}t|j||jdddd}t|j||j|du}|j r|j x}}n*|j d }|rt|d kDr|d nd }|r;t|jd t|dd zt|jd |r|d k7rt|jd |z|jtztz}|j } t|jd|zt|jd| dd zt|jd|d k7rt|jd|z|j\} } | t|jdyt|jddjd| D| fzy)Nz\pgfsetbuttcapz\pgfsetroundcapz\pgfsetrectcap)buttround projectingz\pgfsetmiterjoinz\pgfsetroundjoinz\pgfsetbeveljoin)miterr3bevelr5z(\definecolor{currentfill}{rgb}{%f,%f,%f}z\pgfsetfillcolor{currentfill}\pgfsetfillopacity{%f}z\pgfsetlinewidth{%fpt}z*\definecolor{currentstroke}{rgb}{%f,%f,%f}z!\pgfsetstrokecolor{currentstroke}\pgfsetstrokeopacity{%f}z\pgfsetdash{}{0pt}z\pgfsetdash{%s}{%fpt}rGc3&K|] }d|z yw)z{%fpt}Nr)rDdashs r3rFz5RendererPgf._print_pgf_path_styles.."sGT D 0Gs)r?r= get_capstyle get_joinstyleget_forced_alpha get_alphaget_rgbrtupler mpl_pt_to_inlatex_in_to_pt get_dashesr%) rrr  capstyles joinstyleshas_fill fillopacity strokeopacitylw stroke_rgba dash_offset dash_lists r3rz"RendererPgf._print_pgf_path_styless.0#46  )BOO$567 3224  *R%5%5%789$&   *,,,. 8K-JJLOM(0S\A5E'!*3K  TWW@WRa[)* + TWW> ?  s* TWW7+E F   , . ?jjl 3b89>r?# $ >? C  TWW9MI J"$ Y   TWW3 4 TWW-GYGG#%% &r:cvd|jz }|r|jnd}d|jz}|rR|P|j\}} t|d| t|d| t | d|t | d|f} n| | ||f} |j || D]`\} } | t jk(r0t| \} }t|jd|| z||zfzJ| t jk(rt|jdt| t jk(r0t| \} }t|jd|| z||zfz| t jk(r=t| \}}}}||z||z||z||zf}t|jd |z| t jk(st| \}}}}}}||z||z||z||z||z||zf}t|jd |zc|r|jnd}||\}}}||d z}|d z}t|jd t|jdt|jd||zdd||zddt|jdt!|dt|jdyyy)Nr5rrr)rz&\pgfpathmoveto{\pgfqpoint{%fin}{%fin}}z \pgfpathclosez&\pgfpathlineto{\pgfqpoint{%fin}{%fin}}zH\pgfpathquadraticcurveto{\pgfqpoint{%fin}{%fin}}{\pgfqpoint{%fin}{%fin}}zW\pgfpathcurveto{\pgfqpoint{%fin}{%fin}}{\pgfqpoint{%fin}{%fin}}{\pgfqpoint{%fin}{%fin}}g?z\usepgfmodule{decorations}z(\usepgflibrary{decorations.pathmorphing}z/\pgfkeys{/pgf/decoration/.cd, segment length = r zin, amplitude = zin}z\pgfmathsetseed{rz%\pgfdecoratecurrentpath{random steps})rwr*rmaxminrrMOVETOrAr?r= CLOSEPOLYLINETOCURVE3CURVE4get_sketch_paramsint)rrr2rr r r,rr-r.rpointsrrrcxcypxpyrc1xc1yc2xc2y sketch_paramsrlength randomnesss r3rzRendererPgf._print_pgf_path%s M*,r$$&$ 488+ W___&FB1y)3r!uxi+@1x(#beX*>@DIy(H=D ..yt.D #LFDt{{"V}1Ba%Q()'"23$V}1Ba%Q()$!&vBBaaaa7M!"#$-26]*S#sBq#'37C!GR!VR!VK5" "#/ #>35,,.$  $)6 %E6: #  "?@"MN#-.4qj!,<=().Ad#<=$6s:6Gr"JK"JK! %r:cg}|r|jd|r|jdt|jddj|zy)Nrrz\pgfusepath{%s}r)rRr?r=r%)rrractionss r3rzRendererPgf._pgf_path_drawgsB  NN8 $  NN6 ",sxx/@@Ar:cy)NTrrs r3option_scale_imagezRendererPgf.option_scale_imageosr:c*tjd S)Nzimage.composite_image)r"r#rs r3option_image_nocompositez$RendererPgf.option_image_nocompositess<< 7888r:c |jdd\}}|dk(s|dk(rytjjt |j dds t dtj|j j}d|j|jfz} tj|dddj|j| z |xjdz c_ t!|j d |j#|d |j$z } |,t!|j d || z|| zfz|| z|| z}}n`|j'j)\} } } }}}t!|j d | | z| | z| | z|| z||z| z||z| zfzdx}}t+|duj-}t!|j d t/|||| fzt!|j dy)NrOrr*rGzXstreamed pgf-code does not support raster graphics, consider using the pgf-to-pdf optionz %s-img%d.pngrrr5rz/\pgfsys@transformcm{%f}{%f}{%f}{%f}{%fin}{%fin}zD\pgftext[left,bottom]{%s[interpolate=%s,width=%fin,height=%fin]{%s}}r)shaperrr2existsgetattrr=rr'rr*stemrr fromarraysaver+r?rrwfrozen to_valuesrglowerr)rrrrimrrrr2 fname_imgr tr1tr2tr3tr4tr5tr6interps r3 draw_imagezRendererPgf.draw_imagewsxx|1 6Q!V ww~~gdggvr:;./ / ||DGGLL)"dii1C1C%DD  4R4!&&t{{Y'>? a -. R M   TWW:a!eQU^K Mq5!a%qA+4+;+;+=+G+G+I (Cc3S TWWGAgsQwaqQw!mcAg]44 5IAY$&'--/D.0!Q ++ , +,r:)mtextc 6|j||||||d|y)NTeX)ismathr) draw_text)rrrrrZr[anglers r3draw_texzRendererPgf.draw_texs r1aD%UKr:c Rt||}t|jd|j||j } | dk7r2t|jd| zt|jd| zt |j dd} t|jd| zt|jdt|jdd |z}|jj} g} |r|d k(s|jd k(r|jd k7r|j} |jj| \}}d ddd}ddddd}| jd|| z ddd|| z dd||j||jgn | j!d|| z dd|| z dd|d k7r| j!d|zt|jddj#| d|dt|jd y)!Nrr5r8r9r7z&\definecolor{textcolor}{rgb}{%f,%f,%f}z\pgfsetstrokecolor{textcolor}z\pgfsetfillcolor{textcolor}z\color{textcolor}ranchorcenter_baselineleftrightrG)rrcentertopbottombase)rrbaselinerzx=r inzy=zin, y=zin, left, basez rotate=%fz \pgftext[rz]{rr)r`r?r=rr?rAr@rrwget_rotation_modeget_verticalalignmentget_unitless_position get_transformrextendget_horizontalalignmentrRr%)rrrrrZr[rrralphargbrw text_argsposhalignvaligns r3rzRendererPgf.draw_texts  $At ,-. R   C< TWW7%? @ TWW9EA BBJJL!"1%CcIJ:;89 1 $kkoo !((*h6++-1BB--/C&&(2237DAq$w"EF"h"(B8F   QsU1IR QsU1IR u4467u2245     r!C%&3q H I A:   [50 1)1DaHI+,r:ctjj||\}}}t|jz}||z||z||zfSrC)rrrrBrw)rrZr[rrrdr s r3get_text_width_height_descentz)RendererPgf.get_text_width_height_descentsQ 224,,Q5 1a 488 #1ua!eQU""r:cy)NFrrs r3flipyzRendererPgf.flipysr:c|jj|jz|jj|jzfSrC)r get_figwidthrw get_figheightrs r3get_canvas_width_heightz#RendererPgf.get_canvas_width_heights> ((*TXX5 ))+dhh68 8r:c.|tz|jzSrC)rBrw)rrYs r3points_to_pixelszRendererPgf.points_to_pixelss $txx//r:rC)TF)FN)rrrrrr(rrrrrhrjrrrrrrrrrs@r3rrnsg("$-L31j4(1&f@LDB9'-R;?L.-` #8 0r:rcZeZdZddddZdZdddZd Zdd d Zd Zd Z fdZ xZ S)FigureCanvasPgfzLaTeX PGF picturezLaTeX compiled PGF picturezPortable Network Graphics)pgfpdfpngcy)Nrrrs r3get_default_filetypez$FigureCanvasPgf.get_default_filetypesr:Nbbox_inches_restorec  d}dg}tjD]}|jd|z|jddj|}|jj |jj }}|jj}|j||j||jdt|dt|dt|dt|d ||fzt|d t|j|||t|j|| } |jj| t|d t|d t|dy)Na%% Creator: Matplotlib, PGF backend %% %% To include the figure in your LaTeX document, write %% \input{.pgf} %% %% Make sure the required packages are loaded in your preamble %% \usepackage{pgf} %% %% Also ensure that all the required font packages are loaded; for instance, %% the lmodern package is sometimes necessary when using math font. %% \usepackage{lmodern} %% %% Figures using additional raster images can only be included by \input if %% they are in the same directory as the main LaTeX file. For loading figures %% from other directories you can use the `import` package %% \usepackage{import} %% %% and then include the figures with %% \import{}{.pgf} %% z)%% Matplotlib used the following preamblez%% z%%rz \begingroupz \makeatletterz\begin{pgfpicture}z:\pgfpathrectangle{\pgfpointorigin}{\pgfqpoint{%fin}{%fin}}z&\pgfusepath{use as bounding box, clip}rz\end{pgfpicture}z \makeatotherz \endgroup) r4rrRr%rrrrwr<r?r rdraw) rr=r header_textheader_info_preambler>rrrwrenderers r3_print_pgf_to_fhz FigureCanvasPgf._print_pgf_to_fhsZ .!LL!O..0 8D ' '$ 7 8##D)#yy)=>{{'')4;;+D+D+F1kkoo  %& ^$%&*+Nq6  >?$T[[!Q%0b%A9LN " ()_%\"r:c tj|dd5}tj|stjd|}|j |fi|dddy#1swYyxYw)zy Output pgf macros for drawing the figure so it can be included and rendered in latex documents. rrrN)r open_file_cmfile_requires_unicodecodecs getwriterr)r fname_or_fhkwargsfiles r3 print_pgfzFigureCanvasPgf.print_pgf-sg    S7 C 2t..t40v''06 !D ! !$ 1& 1 2 2 2s AA&&A/metadatac |jj\}}td|xsi}djd|j D}t 5}t j|} |j| dz fi|| dz jdjtd|zd||fzd td d d d g dtjd} tj| dddgt || dz j#d5} tj$|d5} t'j(| | dddddddddy#1swYxYw#1swYxYw#1swYyxYw)z3Use LaTeX to compile a pgf generated figure to pdf.rrc3:K|]\}}t||ywrCrjrDkvs r3rFz,FigureCanvasPgf.print_pdf..<s#B'+q! Q "Bz figure.pgfz figure.texr#\usepackage[pdfinfo={%s}]{hyperref}8\usepackage[papersize={%fin,%fin}, margin=0in]{geometry}\usepackage{pgf}rz \centeringz\input{figure.pgf}z\end{document}rrr-interaction=nonstopmoderr figure.pdfrbwbN)rget_size_inchesr r%itemsrr'rr write_textrr4r"r#r_check_and_log_subprocessrVopenrshutil copyfileobj) rrrrrr info_dictpdfinfortmppath texcommandorigdests r3 print_pdfzFigureCanvasPgf.print_pdf7s{{**,1)%R@ ((B/8/@BB ! /Vll6*G DNN7\1 --% /$$[$7 /;?""4. / /  / /  / / / /  / /s<A#C8C B?&C .C?C C  C CC c.t|jdSrC)rrrs r3 get_rendererzFigureCanvasPgf.get_rendereres4;;--r:cT|jjt| SrC)rdraw_without_renderingrr)rrs r3rzFigureCanvasPgf.drawhs **,w|~r:) rrr filetypesrrrrrrrrrs@r3rrsG+437I;?6#p226/B /.r:rceZdZeZy) _BackendPgfN)rrrr FigureCanvasrr:r3rrps"Lr:rcHeZdZdZdddZdZdZdZdZd Z d d Z d Z y) PdfPagesa A multi-page PDF file using the pgf backend Examples -------- >>> import matplotlib.pyplot as plt >>> # Initialize: >>> with PdfPages('foo.pdf') as pdf: ... # As many times as you like, create a figure fig and save it: ... fig = plt.figure() ... pdf.savefig(fig) ... # When no figure is specified the current figure is saved ... pdf.savefig() Nrc||_d|_|xsij|_t d|j|_t |_y)a Create a new PdfPages object. Parameters ---------- filename : str or path-like Plots using `PdfPages.savefig` will be written to a file at this location. Any older file with the same name is overwritten. metadata : dict, optional Information dictionary object (see PDF reference section 10.2.1 'Document Information Dictionary'), e.g.: ``{'Creator': 'My software', 'Author': 'Me', 'Title': 'Awesome'}``. The standard keys are 'Title', 'Author', 'Subject', 'Keywords', 'Creator', 'Producer', 'CreationDate', 'ModDate', and 'Trapped'. Values have been predefined for 'Creator', 'Producer' and 'CreationDate'. They can be removed by setting them to `None`. Note that some versions of LaTeX engines may ignore the 'Producer' key and set it to themselves. rrN) _output_name _n_figurescopy _metadatar _info_dictr_file)rfilenamers r3rzPdfPages.__init__sB.%".b..0/t~~FY r:c djd|jjD}djtd|zd||fzdt ddg}|j j |jd y) Nrc3:K|]\}}t||ywrCrrs r3rFz)PdfPages._write_header..s#H'+q! Q "Hrrrrrz\setlength{\parindent}{0pt}z\begin{document}%r)r%rrrr4rr<encode)r width_inches height_inchesrrs r3 _write_headerzPdfPages._write_headers((H/3/D/D/FHHyy  2W < G]+ ,  O *  "   ,,W56r:c|SrCrrs r3 __enter__zPdfPages.__enter__s r:c$|jyrC)close)rexc_typeexc_valexc_tbs r3__exit__zPdfPages.__exit__s  r:c|jjd|jdkDr|j|jj y)z Finalize this object, running LaTeX in a temporary directory and moving the final pdf file to *filename*. s\end{document}\nrN)rr<r _run_latexrrs r3rzPdfPages.closes= -. ??Q  OO  r:ctjd}t5}tj|d}|j |j jtj|dd|gt|tj|jd|jdddy#1swYyxYw)Nrz pdf_pages.texrrrz.pdf)r"r#rr'r write_bytesrgetvaluerrrVrmove with_suffixr)rrr tex_sources r3rzPdfPages._run_latexs\\/2  ! KV fo>J  " "4::#6#6#8 9  + +79I& " KK ..v68I8I J K K Ks BB66B?c t|tsR|tj}ntj|}|t d||j j}|j\}}|jdk(r|j||n |jjd||fz|j|jfddd||xjdz c_ y)a5 Save a `.Figure` to this file as a new page. Any other keyword arguments are passed to `~.Figure.savefig`. Parameters ---------- figure : `.Figure` or int, default: the active figure The figure, or index of the figure, that is saved to the file. Nz No figure rs\newpage\ifdefined\pdfpagewidth\pdfpagewidth\else\pagewidth\fi=%fin\ifdefined\pdfpageheight\pdfpageheight\else\pageheight\fi=%fin%% r)rbackendr)rdrr get_activeget_fig_managerrcanvasrrrrrr<savefig)rrrmanagerrrs r3rzPdfPages.savefigs&&)~..*--f5 :fX!677^^**F..0 v ??a    uf - JJ  !&/*  tzzI%I&I 1r:c|jS)z=Return the current number of pages in the multipage pdf file.)rrs r3 get_pagecountzPdfPages.get_pagecounts r:rC) rrrrrrrrrrrrrr:r3rrus6 .2: 7 K"Hr:r)@rreriorloggingrrrr'rrptempfilerrPILr matplotlibr"rrr(matplotlib.backend_basesrr r r !matplotlib.backends.backend_mixedr matplotlib.backends.backend_pdfr rmatplotlib.pathrmatplotlib.figurermatplotlib.font_managerrmatplotlib._pylab_helpersr getLoggerrrVrr4latex_pt_to_inrCrB mpl_in_to_ptr9r?r`rjrrrrrrrrFigureManagerPgfexportrrrr:r3r(s9   '0@- $2)w",&Vn$ L =*Z A6  UUpQ  |0,|0~ }&}@% #(##}}r: