KGRKJGETMRETU895U-589TY5MIGM5JGB5SDFESFREWTGR54TY
Server : Apache
System : Linux server112.speedpacket.com 3.10.0-962.3.2.lve1.5.36.el7.x86_64 #1 SMP Mon May 18 02:16:06 EDT 2020 x86_64
User : equistyl ( 1341)
PHP Version : 8.1.30
Disable Function : NONE
Directory :  /lib64/python2.7/site-packages/matplotlib/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : //lib64/python2.7/site-packages/matplotlib/figure.pyo
�
r`]c@sdZddlmZddlZddlmZddlZddlm	Z	ddlm
Z
ddlmZddl
jZddl
mZmZddljZdd	lmZmZdd
lmZddlmZddljZddlmZmZmZdd
l m!Z!m"Z"ddl#m$Z$ddl%m&Z&ddl'm(Z(m)Z)ddl*m+Z+m,Z,ddl-m.Z.m/Z/m0Z0m1Z1ddl2m3Z3e
j4j5de(��defd��YZ6dfd��YZ7defd��YZ8d�Z9e
j4j5dej:e8��dS(s5
The figure module provides the top-level
:class:`~matplotlib.artist.Artist`, the :class:`Figure`, which
contains all the plot elements.  The following classes are defined

:class:`SubplotParams`
    control the default spacing of the subplots

:class:`Figure`
    top level container for all plot elements


i����(tprint_functionN(t
itemgetter(trcParams(t	docstring(t__version__(tArtisttallow_rasterization(tStacktiterable(t_image(tFigureImage(tAxestSubplotBasetsubplot_class_factory(tBlockingMouseInputtBlockingKeyMouseInput(tLegend(t	Rectangle(tget_projection_namestprocess_projection_requirements(tTextt_process_text_args(tAffine2DtBboxtBboxTransformTotTransformedBbox(tNonGuiExceptiontprojection_namest	AxesStackcBsheZdZd�Zd�Zd�Zd�Zd�Zd�Zd�Z	d�Z
d	�Zd
�ZRS(s
    Specialization of the Stack to handle all tracking of Axes in a Figure.
    This stack stores ``key, (ind, axes)`` pairs, where:

        * **key** should be a hash of the args and kwargs
          used in generating the Axes.
        * **ind** is a serial number for tracking the order
          in which axes were added.

    The AxesStack is a callable, where ``ax_stack()`` returns
    the current axes. Alternatively the :meth:`current_key_axes` will
    return the current key and associated axes.

    cCstj|�d|_dS(Ni(Rt__init__t_ind(tself((s7/usr/lib64/python2.7/site-packages/matplotlib/figure.pyR@s
cCsIg|jD]\}}|^q
}|j�g|D]\}}|^q3S(sX
        Return a list of the Axes instances that have been added to the figure
        (t	_elementstsort(Rtktatia_listti((s7/usr/lib64/python2.7/site-packages/matplotlib/figure.pytas_listDs"
cCs0t|j�j|�}|dkr(dS|dS(sp
        Return the Axes instance that was added with *key*.
        If it is not present, return None.
        iN(tdictR tgettNone(Rtkeytitem((s7/usr/lib64/python2.7/site-packages/matplotlib/figure.pyR(LscCsTtg|jD]$\}\}}|||ff^q
�|\}}|||ffS(N(R'R (RteR"tindR#((s7/usr/lib64/python2.7/site-packages/matplotlib/figure.pyt_entry_from_axesVsDcCstj||j|��dS(sRemove the axes from the stack.N(RtremoveR.(RR#((s7/usr/lib64/python2.7/site-packages/matplotlib/figure.pyR/ZscCstj||j|��S(sa
        Move the given axes, which must already exist in the
        stack, to the top.
        (RtbubbleR.(RR#((s7/usr/lib64/python2.7/site-packages/matplotlib/figure.pyR0^scCs�t|t�s"td|��nyt|�Wn!tk
rStd|��nX|j|�}|dk	r�tj|||f�t	j
d|�n||kr�dS|jd7_tj|||j|ff�S(s�
        Add Axes *a*, with key *key*, to the stack, and return the stack.

        If *a* is already on the stack, don't add it again, but
        return *None*.
        s#second argument, %s, is not an Axess&first argument, %s, is not a valid keys.key %s already existed; Axes is being replacediN(
t
isinstanceRt
ValueErrorthasht	TypeErrorR(R)RR/twarningstwarnRtpush(RR*R#t
a_existing((s7/usr/lib64/python2.7/site-packages/matplotlib/figure.pytaddes	
cCsIt|j�s|j|jfS|j|j\}\}}||fSdS(s�
        Return a tuple of ``(key, axes)`` for the active axes.

        If no axes exists on the stack, then returns ``(None, None)``.

        N(tlenR t_defaultt_pos(RR*tindextaxes((s7/usr/lib64/python2.7/site-packages/matplotlib/figure.pytcurrent_key_axes�scCs|j�dS(Ni(R?(R((s7/usr/lib64/python2.7/site-packages/matplotlib/figure.pyt__call__�scCs||j�kS(N(R&(RR#((s7/usr/lib64/python2.7/site-packages/matplotlib/figure.pyt__contains__�s(
t__name__t
__module__t__doc__RR&R(R.R/R0R9R?R@RA(((s7/usr/lib64/python2.7/site-packages/matplotlib/figure.pyR1s			
					
	t
SubplotParamscBsMeZdZddddddd�Zddddddd�Zd�ZRS(s6
    A class to hold the parameters for a subplot
    cCs)t|_|j||||||�dS(s�
        All dimensions are fraction of the figure width or height.
        All values default to their rc params

        The following attributes are available

        *left*  : 0.125
            The left side of the subplots of the figure

        *right* : 0.9
            The right side of the subplots of the figure

        *bottom* : 0.1
            The bottom of the subplots of the figure

        *top* : 0.9
            The top of the subplots of the figure

        *wspace* : 0.2
            The amount of width reserved for blank space between subplots

        *hspace* : 0.2
            The amount of height reserved for white space between subplots
        N(tTruetvalidatetupdate(Rtlefttbottomtrightttoptwspacethspace((s7/usr/lib64/python2.7/site-packages/matplotlib/figure.pyR�s	csMt�dd
��t�dd
��t�dd
��t�dd
��t�dd
��t�dd
���jd|��jd|��jd|��jd|��jd|��jd|��������fd�}�jrI�j�jkr|�td��n�j�jkrI|�td	��qInd
S(s�
        Update the current values.  If any kwarg is None, default to
        the current value, if set, otherwise to rc

        RIRKRLRJRMRNcs:��_��_��_��_��_��_dS(N(RIRKRLRJRMRN((Rt
thisbottomt
thishspacetthisleftt	thisrighttthistopt
thiswspace(s7/usr/lib64/python2.7/site-packages/matplotlib/figure.pytreset�s					sleft cannot be >= rightsbottom cannot be >= topN(	tgetattrR)t_update_thisRGRIRKR2RJRL(RRIRJRKRLRMRNRU((RRORPRQRRRSRTs7/usr/lib64/python2.7/site-packages/matplotlib/figure.pyRH�s(!	cCsX|dkrDt||d�}|dkrDd|}t|}qDnt|||�dS(Nsfigure.subplot.(R)RVRtsetattr(RtstvalR*((s7/usr/lib64/python2.7/site-packages/matplotlib/figure.pyRW�s
N(RBRCRDR)RRHRW(((s7/usr/lib64/python2.7/site-packages/matplotlib/figure.pyRE�s'tFigurec	Bs�eZdZd�ZdFdFdFdFdedFdFd�Zed�Zd�Ze	dedd�Z
d	�Zd
�Ze	ee�Z
d�Zd�Zd
ddd�Zd�Zd�Zd�Zd�Zd�ZdFd�ZdddFdFdFdFdFdFd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd �Zd!�Z d"�Z!d#�Z"d$�Z#d%�Z$d&�Z%d'�Z&d(�Z'e(j)d)��Z*e(j)d*��Z+e,d+�Z-d,�Z.e/d-��Z0d.�Z1d/�Z2d0�Z3e(j)d1��Z4d2�Z5e(j)d3��Z6d4�Z7d5�Z8d6�Z9d7�Z:d8�Z;d9�Z<e(j)dFdFd:��Z=d;�Z>d<ded<d=d>d?�Z?d@dA�Z@dB�ZAdC�ZBdFdDdFdFdFdE�ZCRS(Gs�
    The Figure instance supports callbacks through a *callbacks*
    attribute which is a :class:`matplotlib.cbook.CallbackRegistry`
    instance.  The events you can connect to are 'dpi_changed', and
    the callback will be called with ``func(fig)`` where fig is the
    :class:`Figure` instance.

    *patch*
       The figure patch is drawn by a
       :class:`matplotlib.patches.Rectangle` instance

    *suppressComposite*
       For multiple figure images, the figure will make composite
       images depending on the renderer option_image_nocomposite
       function.  If suppressComposite is True|False, this will
       override the renderer.
    cCsdt|jj�S(Ns
Figure(%gx%g)(ttupletbboxtsize(R((s7/usr/lib64/python2.7/site-packages/matplotlib/figure.pyt__str__�sgc		
Cs�tj|�tj�|_|dkr5td}n|dkrNtd}n|dkrgtd}n|dkr�td}nt�|_||_	t
jdd|�|_t
|j|j�|_||_t|j�|_tddddd	dd
|d|d|�|_|_|j|j�|jjt�td
|_d|_|dkret�}n||_|j|�t�|_|j�d|_ dS(s�
        *figsize*
            w,h tuple in inches

        *dpi*
            Dots per inch

        *facecolor*
            The figure patch facecolor; defaults to rc ``figure.facecolor``

        *edgecolor*
            The figure patch edge color; defaults to rc ``figure.edgecolor``

        *linewidth*
            The figure patch edge linewidth; the default linewidth of the frame

        *frameon*
            If *False*, suppress drawing the figure frame

        *subplotpars*
            A :class:`SubplotParams` instance, defaults to rc

        *tight_layout*
            If *False* use *subplotpars*; if *True* adjust subplot
            parameters using :meth:`tight_layout`.  Defaults to
            rc ``figure.autolayout``.
        sfigure.figsizes
figure.dpisfigure.facecolorsfigure.edgecoloritxytwidthitheightt	facecolort	edgecolort	linewidths	axes.holdN(ii(!RRtcbooktCallbackRegistryt	callbacksR)RRtdpi_scale_transtdpiRtfrom_boundstbbox_inchesRR]tframeonRttransFigureRtpatchtfigurePatcht_set_artist_propstset_aatFalset_holdtcanvasREtsubplotparstset_tight_layoutRt_axstacktclft_cachedRenderer(	RtfigsizeRjRcRdReRmRvttight_layout((s7/usr/lib64/python2.7/site-packages/matplotlib/figure.pyRs>%




		
		

cCs�yt|jd�}Wn#tk
r;}td|��nX|dk	rqy|j�dSWqqtk
rmqqXn|r�ddl}|jd�ndS(s�
        If using a GUI backend with pyplot, display the figure window.

        If the figure was not created using
        :func:`~matplotlib.pyplot.figure`, it will lack a
        :class:`~matplotlib.backend_bases.FigureManagerBase`, and
        will raise an AttributeError.

        For non-GUI backends, this does nothing, in which case
        a warning will be issued if *warn* is True (default).
        tmanagerse%s
    Figure.show works only for figures managed by pyplot,
    normally created by pyplot.figure().Ni����sJmatplotlib is currently using a non-GUI backend, so cannot show the figure(RVRutAttributeErrorR)tshowRR5R6(RR6R}terrR5((s7/usr/lib64/python2.7/site-packages/matplotlib/figure.pyRMs

cCs
|jj�S(N(RxR&(R((s7/usr/lib64/python2.7/site-packages/matplotlib/figure.pyt	_get_axeslstfgettdocs!Read-only: list of axes in FigurecCs|jS(N(t_dpi(R((s7/usr/lib64/python2.7/site-packages/matplotlib/figure.pyt_get_dpiqscCs9||_|jj�j||�|jjd|�dS(Ntdpi_changed(R�RitcleartscaleRhtprocess(RRj((s7/usr/lib64/python2.7/site-packages/matplotlib/figure.pyt_set_dpiss	cCs|jS(sX
        Return the Boolean flag, True to use :meth`tight_layout` when drawing.
        (t_tight(R((s7/usr/lib64/python2.7/site-packages/matplotlib/figure.pytget_tight_layoutyscCs2|dkrtd}nt|�}||_dS(s�
        Set whether :meth:`tight_layout` is used upon drawing.
        If None, the rcParams['figure.autolayout'] value will be set.

        ACCEPTS: [True | False | None]
        sfigure.autolayoutN(R)RtboolR�(Rttight((s7/usr/lib64/python2.7/site-packages/matplotlib/figure.pyRws
g�������?iRKcCs,tjg|jD]}t|d�^q�}t|j�dkr~x�|jdj�D] }|j|�|j|�qWWn�|rx�|j�D]w}|j	�r�xb|j�D] }|j|�|j|�q�Wq�x!|j�D]}|j
t�q�W|jd�q�Wn|r(|j
d|�ndS(s_
        Date ticklabels often overlap, so it is useful to rotate them
        and right align them.  Also, a common use case is a number of
        subplots with shared xaxes where the x-axis is date data.  The
        ticklabels are often long, and it helps to rotate them on the
        bottom subplot and turn them off on other subplots, as well as
        turn off xlabels.

        *bottom*
            The bottom of the subplots for :meth:`subplots_adjust`

        *rotation*
            The rotation of the xtick labels

        *ha*
            The horizontal alignment of the xticklabels
        tis_last_rowiitRJN(tnptalltrueR>thasattrR:tget_xticklabelstset_hatset_rotationtget_axesR�tset_visibleRst
set_xlabeltsubplots_adjust(RRJtrotationthataxtallsubplotstlabel((s7/usr/lib64/python2.7/site-packages/matplotlib/figure.pyt
autofmt_xdate�s .

cCs�|jg}|j|j�|j|j�|j|j�|j|j�|j|j�|j|j�|j|j�|S(s-get a list of artists contained in the figure(	RotextendtartistsR>tlinestpatchesttextstimagestlegends(Rtchildren((s7/usr/lib64/python2.7/site-packages/matplotlib/figure.pytget_children�scCsDt|j�r|j||�S|jj|j|j�}|ifS(s_
        Test whether the mouse event occurred on the figure.

        Returns True,{}
        (tcallablet	_containsR]tcontainstxty(Rt
mouseeventtinside((s7/usr/lib64/python2.7/site-packages/matplotlib/figure.pyR��scOs|jS(s=get the figure bounding box in display space; kwargs are void(R](Rtargstkwargs((s7/usr/lib64/python2.7/site-packages/matplotlib/figure.pytget_window_extent�scKs�|jdd�}|jdd�}d|krId|krId|d<nd|krnd	|krnd
|d<n|j||||�}|S(s�
        Add a centered title to the figure.

        kwargs are :class:`matplotlib.text.Text` properties.  Using figure
        coordinates, the defaults are:

          *x* : 0.5
            The x location of the text in figure coords

          *y* : 0.98
            The y location of the text in figure coords

          *horizontalalignment* : 'center'
            The horizontal alignment of the text

          *verticalalignment* : 'top'
            The vertical alignment of the text

        A :class:`matplotlib.text.Text` instance is returned.

        Example::

          fig.suptitle('this is the figure title', fontsize=12)
        R�g�?R�g\��(\�?thorizontalalignmentR�tcentertverticalalignmenttvaRL(tpopttext(RttR�R�R�((s7/usr/lib64/python2.7/site-packages/matplotlib/figure.pytsuptitle�s

cCs
||_dS(sb
        Set the canvas the contains the figure

        ACCEPTS: a FigureCanvas instance
        N(Ru(RRu((s7/usr/lib64/python2.7/site-packages/matplotlib/figure.pyt
set_canvas�scCs)|dkr|j|_n	||_dS(s

        Set the hold state.  If hold is None (default), toggle the
        hold state.  Else set the hold state to boolean value b.

        Eg::

            hold()      # toggle hold
            hold(True)  # hold is on
            hold(False) # hold is off
        N(R)Rt(Rtb((s7/usr/lib64/python2.7/site-packages/matplotlib/figure.pythold�sic
Ks�|js|j�nt||||||	|
�}|j|�|j|�|dkrm|j||�n|jj|�|S(s�
        Adds a non-resampled image to the figure.

        call signatures::

          figimage(X, **kwargs)

        adds a non-resampled array *X* to the figure.

        ::

          figimage(X, xo, yo)

        with pixel offsets *xo*, *yo*,

        *X* must be a float array:

        * If *X* is MxN, assume luminance (grayscale)
        * If *X* is MxNx3, assume RGB
        * If *X* is MxNx4, assume RGBA

        Optional keyword arguments:

          =========   ==========================================================
          Keyword     Description
          =========   ==========================================================
          xo or yo    An integer, the *x* and *y* image offset in pixels
          cmap        a :class:`matplotlib.colors.Colormap` instance, eg cm.jet.
                      If *None*, default to the rc ``image.cmap`` value
          norm        a :class:`matplotlib.colors.Normalize` instance. The
                      default is normalization().  This scales luminance -> 0-1
          vmin|vmax   are used to scale a luminance image to 0-1.  If either is
                      *None*, the min and max of the luminance values will be
                      used.  Note if you pass a norm instance, the settings for
                      *vmin* and *vmax* will be ignored.
          alpha       the alpha blending value, default is *None*
          origin      [ 'upper' | 'lower' ] Indicates where the [0,0] index of
                      the array is in the upper left or lower left corner of
                      the axes. Defaults to the rc image.origin value
          =========   ==========================================================

        figimage complements the axes image
        (:meth:`~matplotlib.axes.Axes.imshow`) which will be resampled
        to fit the current axes.  If you want a resampled image to
        fill the entire figure, you can define an
        :class:`~matplotlib.axes.Axes` with size [0,1,0,1].

        An :class:`matplotlib.image.FigureImage` instance is returned.

        .. plot:: mpl_examples/pylab_examples/figimage_demo.py


        Additional kwargs are Artist kwargs passed on to
        :class:`~matplotlib.image.FigureImage`
        N(	RtRyR
t	set_arrayt	set_alphaR)tset_climR�tappend(RtXtxotyotalphatnormtcmaptvmintvmaxtoriginR�tim((s7/usr/lib64/python2.7/site-packages/matplotlib/figure.pytfigimagesB	


c
Os�|jdt�}t|�dkr7|d\}}n|\}}|j}||f|j_|r�|j}||}||}t|jdd�}	|	dk	r�|	j	t
|�t
|��q�ndS(s�
        set_size_inches(w,h, forward=False)

        Set the figure size in inches

        Usage::

             fig.set_size_inches(w,h)  # OR
             fig.set_size_inches((w,h) )

        optional kwarg *forward=True* will cause the canvas size to be
        automatically updated; eg you can resize the figure window
        from the shell

        ACCEPTS: a w,h tuple with w,h in inches
        tforwardiiR}N(R(RsR:RjRltp1RVRuR)tresizetint(
RR�R�R�twthtdpivaltcanvaswtcanvashR}((s7/usr/lib64/python2.7/site-packages/matplotlib/figure.pytset_size_inchesSs		

cCs
|jjS(N(RlR�(R((s7/usr/lib64/python2.7/site-packages/matplotlib/figure.pytget_size_inchesvscCs
|jj�S(s*Get the edge color of the Figure rectangle(Rot
get_edgecolor(R((s7/usr/lib64/python2.7/site-packages/matplotlib/figure.pyR�yscCs
|jj�S(s*Get the face color of the Figure rectangle(Rot
get_facecolor(R((s7/usr/lib64/python2.7/site-packages/matplotlib/figure.pyR�}scCs
|jjS(sReturn the figwidth as a float(RlRa(R((s7/usr/lib64/python2.7/site-packages/matplotlib/figure.pytget_figwidth�scCs
|jjS(sReturn the figheight as a float(RlRb(R((s7/usr/lib64/python2.7/site-packages/matplotlib/figure.pyt
get_figheight�scCs|jS(sReturn the dpi as a float(Rj(R((s7/usr/lib64/python2.7/site-packages/matplotlib/figure.pytget_dpi�scCs|jS(s"get the boolean indicating frameon(Rm(R((s7/usr/lib64/python2.7/site-packages/matplotlib/figure.pytget_frameon�scCs|jj|�dS(sv
        Set the edge color of the Figure rectangle

        ACCEPTS: any matplotlib color - see help(colors)
        N(Rot
set_edgecolor(Rtcolor((s7/usr/lib64/python2.7/site-packages/matplotlib/figure.pyR��scCs|jj|�dS(sv
        Set the face color of the Figure rectangle

        ACCEPTS: any matplotlib color - see help(colors)
        N(Rot
set_facecolor(RR�((s7/usr/lib64/python2.7/site-packages/matplotlib/figure.pyR��scCs
||_dS(sM
        Set the dots-per-inch of the figure

        ACCEPTS: float
        N(Rj(RRZ((s7/usr/lib64/python2.7/site-packages/matplotlib/figure.pytset_dpi�scCs||j_dS(sO
        Set the width of the figure in inches

        ACCEPTS: float
        N(Rltx1(RRZ((s7/usr/lib64/python2.7/site-packages/matplotlib/figure.pytset_figwidth�scCs||j_dS(sP
        Set the height of the figure in inches

        ACCEPTS: float
        N(Rlty1(RRZ((s7/usr/lib64/python2.7/site-packages/matplotlib/figure.pyt
set_figheight�scCs
||_dS(so
        Set whether the figure frame (background) is displayed or invisible

        ACCEPTS: boolean
        N(Rm(RR�((s7/usr/lib64/python2.7/site-packages/matplotlib/figure.pytset_frameon�scCs2|jj|�x|jD]}||�qWdS(s4remove a from the figure and update the current axesN(RxR/t_axobservers(RR#tfunc((s7/usr/lib64/python2.7/site-packages/matplotlib/figure.pytdelaxes�scOs4d�}d�}||�||j��f}|S(s*make a hashable key out of args and kwargscSsUg}xB|D]:\}}t|�r4t|�}n|j||f�q
Wt|�S(N(RR\R�(titemstretR"tv((s7/usr/lib64/python2.7/site-packages/matplotlib/figure.pytfixitems�scSsIg}x6|D].}t|�r.t|�}n|j|�q
Wt|�S(N(RR\R�(R�R�R#((s7/usr/lib64/python2.7/site-packages/matplotlib/figure.pytfixlist�s
(t	iteritems(RR�R�R�R�R*((s7/usr/lib64/python2.7/site-packages/matplotlib/figure.pyt	_make_key�s			cOs
t|�sdS|j||�}|jj|�}|dk	rQ|j|�|St|dt�rq|d}nu|d}t|||�\}}}|jj|�}|dk	r�t||�r�|j|�|S||||�}|jj	||�|j|�|S(s�
        Add an axes at position *rect* [*left*, *bottom*, *width*,
        *height*] where all quantities are in fractions of figure
        width and height.  kwargs are legal
        :class:`~matplotlib.axes.Axes` kwargs plus *projection* which
        sets the projection type of the axes.  (For backward
        compatibility, ``polar=True`` may also be provided, which is
        equivalent to ``projection='polar'``).  Valid values for
        *projection* are: %(projection_names)s.  Some of these
        projections support  additional kwargs, which may be provided
        to :meth:`add_axes`. Typical usage::

            rect = l,b,w,h
            fig.add_axes(rect)
            fig.add_axes(rect, frameon=False, axisbg='g')
            fig.add_axes(rect, polar=True)
            fig.add_axes(rect, projection='polar')
            fig.add_axes(ax)

        If the figure already has an axes with the same parameters,
        then it will simply make that axes current and return it.  If
        you do not want this behavior, e.g. you want to force the
        creation of a new Axes, you must use a unique set of args and
        kwargs.  The axes :attr:`~matplotlib.axes.Axes.label`
        attribute has been exposed for this purpose.  Eg., if you want
        two axes that are otherwise identical to be added to the
        figure, make sure you give them unique labels::

            fig.add_axes(rect, label='axes1')
            fig.add_axes(rect, label='axes2')

        In rare circumstances, add_axes may be called with a single
        argument, an Axes instance already created in the present
        figure but not in the figure's list of axes.  For example,
        if an axes has been removed with :meth:`delaxes`, it can
        be restored with::

            fig.add_axes(ax)

        In all cases, the :class:`~matplotlib.axes.Axes` instance
        will be returned.

        In addition to *projection*, the following kwargs are supported:

        %(Axes)s
        Ni(
R:R�RxR(R)tscaR1RRR9(RR�R�R*R�R#trecttprojection_class((s7/usr/lib64/python2.7/site-packages/matplotlib/figure.pytadd_axes�s(0




cOsAt|�sdSt|�dkrgt|dt�rgtgt|d�D]}t|�^qI�}nt|dt�r�|d}|j||�}n�t|||�\}}}|jj	|�}|dk	rt||�r�|j|�|S|jj|�nt
|�|||�}|jj||�|j|�|S(sz
        Add a subplot.  Examples::

            fig.add_subplot(111)

            # equivalent but more general
            fig.add_subplot(1,1,1)

            # add subplot with red background
            fig.add_subplot(212, axisbg='r')

            # add a polar subplot
            fig.add_subplot(111, projection='polar')

            # add Subplot instance sub
            fig.add_subplot(sub)

        *kwargs* are legal :class:`~matplotlib.axes.Axes` kwargs plus
        *projection*, which chooses a projection type for the axes.
        (For backward compatibility, *polar=True* may also be
        provided, which is equivalent to *projection='polar'*). Valid
        values for *projection* are: %(projection_names)s.  Some of
        these projections
        support additional *kwargs*, which may be provided to
        :meth:`add_axes`.

        The :class:`~matplotlib.axes.Axes` instance will be returned.

        If the figure already has a subplot with key (*args*,
        *kwargs*) then it will simply make that subplot current and
        return it.

        The following kwargs are supported:

        %(Axes)s
        Nii(R:R1R�R\tstrRR�RRxR(R)R�R/R
R9(RR�R�tcR#R*R�R�((s7/usr/lib64/python2.7/site-packages/matplotlib/figure.pytadd_subplot,s$&%2


cCs�d|_tj�|_x.t|j�D]}|j�|j|�q(Wt	|j
dd�}|dk	rw|j�n|jj
�g|_g|_g|_g|_g|_g|_|s�g|_ndS(s�
        Clear the figure.

        Set *keep_observers* to True if, for example,
        a gui widget is tracking the axes in the figure.
        ttoolbarN(R)tsuppressCompositeRfRgRhR\R>tclaR�RVRuRHRxR�R�R�R�R�R�R�R�(Rtkeep_observersR�R�((s7/usr/lib64/python2.7/site-packages/matplotlib/figure.pyRyxs"	


						cCs|j�dS(s>
        Clear the figure -- synonym for :meth:`clf`.
        N(Ry(R((s7/usr/lib64/python2.7/site-packages/matplotlib/figure.pyR��sc	s��j�sdS�jd��j�rZ�jrZy�j��WqZtk
rVqZXn�jrv�jj��ng}x6�j	D]+}|j
|j�||j�gf�q�Wx6�jD]+}|j
|j�||j�gf�q�Wx6�j
D]+}|j
|j�||j�gf�q�W�j�}�jdk	rN�j}nt�j�dks�|s�tjg�jD]��j^qy�r�x�jD]+}|j
|j�||j�gf�q�Wn��j�}g�jD]$��j|��j�jf^q�}tj�jj|�jj||��t�_ �jj!\��}}�����fd�}	|j
�jdj��jd|	gf�x6�jD]+}|j
|j�||j�gf�q�Wx6�j"D]+}|j
|j�||j�gf�q�Wx6�j#D]+}|j
|j�||j�gf�qWg|D]}
|
dj$�sR|
^qR}|j%dt&d��x$|D]\}}}}
||
�q�W�j'd���_(�j)j*��dS(su
        Render the figure using :class:`matplotlib.backend_bases.RendererBase`
        instance *renderer*.
        NtfigureicsS�j�}|j�j�|j�j���j|����|j�dS(N(tnew_gctset_clip_rectangleR]t
set_clip_patht
get_clip_patht
draw_imagetrestore(tgc(R�R�tltrendererR(s7/usr/lib64/python2.7/site-packages/matplotlib/figure.pytdraw_composite�s
iR*(+tget_visiblet
open_groupR�R>R|R2RmRotdrawR�R�t
get_zorderR�R�toption_image_nocompositeR�R)R:R�RftallequalR�tget_image_magnificationt
make_imagetoxtoyR	tfrom_imagesR]RbRaRstis_grayscaletboundsR�R�tget_animatedR!Rtclose_groupRzRut
draw_event(RRtdsuR#t
not_compositetmagtimsR�R�RtrowtzorderR�R�((R�R�RRRs7/usr/lib64/python2.7/site-packages/matplotlib/figure.pyR
�s^

	)))),1
		-))))
	cCs|j|j�dS(s�
        draw :class:`matplotlib.artist.Artist` instance *a* only --
        this is available only after the figure is drawn
        N(R
Rz(RR#((s7/usr/lib64/python2.7/site-packages/matplotlib/figure.pytdraw_artist�scCs|jS(N(R>(R((s7/usr/lib64/python2.7/site-packages/matplotlib/figure.pyR��scOs,t|||||�}|jj|�|S(s�

        Place a legend in the figure.  Labels are a sequence of
        strings, handles is a sequence of
        :class:`~matplotlib.lines.Line2D` or
        :class:`~matplotlib.patches.Patch` instances, and loc can be a
        string or an integer specifying the legend location

        USAGE::

          legend( (line1, line2, line3),
                  ('label1', 'label2', 'label3'),
                  'upper right')

        The *loc* location codes are::

          'best' : 0,          (currently not supported for figure legends)
          'upper right'  : 1,
          'upper left'   : 2,
          'lower left'   : 3,
          'lower right'  : 4,
          'right'        : 5,
          'center left'  : 6,
          'center right' : 7,
          'lower center' : 8,
          'upper center' : 9,
          'center'       : 10,

        *loc* can also be an (x,y) tuple in figure coords, which
        specifies the lower left of the legend box.  figure coords are
        (0,0) is the left, bottom of the figure and 1,1 is the right,
        top.

        Keyword arguments:

          *prop*: [ *None* | FontProperties | dict ]
            A :class:`matplotlib.font_manager.FontProperties`
            instance. If *prop* is a dictionary, a new instance will be
            created with *prop*. If *None*, use rc settings.

          *numpoints*: integer
            The number of points in the legend line, default is 4

          *scatterpoints*: integer
            The number of points in the legend line, default is 4

          *scatteroffsets*: list of floats
            a list of yoffsets for scatter symbols in legend

          *markerscale*: [ *None* | scalar ]
            The relative size of legend markers vs. original. If *None*, use rc
            settings.

          *fancybox*: [ *None* | *False* | *True* ]
            if *True*, draw a frame with a round fancybox.  If *None*, use rc

          *shadow*: [ *None* | *False* | *True* ]
            If *True*, draw a shadow behind legend. If *None*, use rc settings.

          *ncol* : integer
            number of columns. default is 1

          *mode* : [ "expand" | *None* ]
            if mode is "expand", the legend will be horizontally expanded
            to fill the axes area (or *bbox_to_anchor*)

          *title* : string
            the legend title

        Padding and spacing between various elements use following keywords
        parameters. The dimensions of these values are given as a fraction
        of the fontsize. Values from rcParams will be used if None.

        ================   ==================================================================
        Keyword            Description
        ================   ==================================================================
        borderpad          the fractional whitespace inside the legend border
        labelspacing       the vertical space between the legend entries
        handlelength       the length of the legend handles
        handletextpad      the pad between the legend handle and text
        borderaxespad      the pad between the axes and legend border
        columnspacing      the spacing between columns
        ================   ==================================================================

        .. Note:: Not all kinds of artist are supported by the legend.
                  See LINK (FIXME) for details.

        **Example:**

        .. plot:: mpl_examples/pylab_examples/figlegend_demo.py
        (RR�R�(RthandlestlabelsR�R�R((s7/usr/lib64/python2.7/site-packages/matplotlib/figure.pytlegend�s[cOs[ti||�}td|d|d|�}|j|�|j|�|jj|�|S(sn
        Add text to figure.

        Call signature::

          text(x, y, s, fontdict=None, **kwargs)

        Add text to figure at location *x*, *y* (relative 0-1
        coords). See :func:`~matplotlib.pyplot.text` for the meaning
        of the other arguments.

        kwargs control the :class:`~matplotlib.text.Text` properties:

        %(Text)s
        R�R�R�(RRRHRqR�R�(RR�R�RYR�R�toverrideR�((s7/usr/lib64/python2.7/site-packages/matplotlib/figure.pyR�Ys

cCs0||kr|j|�n|j|j�dS(N(t
set_figuret
set_transformRn(RR#((s7/usr/lib64/python2.7/site-packages/matplotlib/figure.pyRquscKs�|jj�\}}|dk	r�|s+|S|j�}t||�\}}}|d}|d}||kr�t||�r�|Sn|jddd|�S(s
        Return the current axes, creating one if necessary

        The following kwargs are supported for ensuring the returned axes
        adheres to the given projection etc., and for axes creation if
        the active axes does not exist:

        %(Axes)s

        iN(RxR?R)tcopyRR1R�(RR�tckeytcaxtkwargs_copyR�t_R*((s7/usr/lib64/python2.7/site-packages/matplotlib/figure.pytgcazs

cCs2|jj|�x|jD]}||�qW|S(s)Set the current axes to be a and return a(RxR0R�(RR#R�((s7/usr/lib64/python2.7/site-packages/matplotlib/figure.pyR��scCs:x3t|j�D]"}|j�}|dk	r|SqWdS(sZ
        helper for :func:`~matplotlib.pyplot.gci`;
        do not use elsewhere.
        N(treversedR>t_gciR)(RR�R�((s7/usr/lib64/python2.7/site-packages/matplotlib/figure.pyR,�s
cCs�|jj�}xd	D]}|j|d�qWt|d<t|jdd�dk	r�|jj}ddl}||j	j
jj�kr�t
|d<q�n|S(
NR�RRuRzt__mpl_version__R}i����t_restore_to_pylab(s_axobserverssshowscanvass_cachedRenderer(t__dict__R%R�R)t_mpl_versionRVRuR}tmatplotlib._pylab_helperst_pylab_helperstGcftfigstvaluesRF(Rtstatetattr_to_popR}t
matplotlib((s7/usr/lib64/python2.7/site-packages/matplotlib/figure.pyt__getstate__�s

c	sB|jd�}|jdt�}|tkrPddl}|jd|f�n||_g|_d|_|r>ddl	j
}ddlj�|j
�}|r�t|�dnd}|jj||��|j�r��j|j��n��fd�}�jjd|��_�jj��||_|j�ndS(NR-R.i����sWThis figure was saved with matplotlib version %s and is unlikely to function correctly.ics�jj��dS(N(R3t
set_active(tevent(tmgrt
pylab_helpers(s7/usr/lib64/python2.7/site-packages/matplotlib/figure.pytmake_active�stbutton_press_event(R�RsR0R5R6R/R�R)Rutmatplotlib.pyplottpyplotR1R2tget_fignumstmaxt_backend_modtnew_figure_manager_given_figuret	get_labeltset_window_titletmpl_connectt_cidgcfR3R:tnumbertdraw_if_interactive(	RR6tversiontrestore_to_pylabR5tplttallnumstnumR>((R<R=s7/usr/lib64/python2.7/site-packages/matplotlib/figure.pyt__setstate__�s.					cCs|jj|�dS(s=whenever the axes state change, ``func(self)`` will be calledN(R�R�(RR�((s7/usr/lib64/python2.7/site-packages/matplotlib/figure.pytadd_axobserver�scOs>|jdtd�|jdt�}|r�|jdd�|jdd�g}x~|jD]H}|j}|j|j�|j�f�|j	d�|j
d�q\Wn(|jdtd�|jdtd�|jj||�|r:xKt
|j|�D]4\}}|jj	|d	�|jj
|d
�q�WndS(sa

        Save the current figure.

        Call signature::

          savefig(fname, dpi=None, facecolor='w', edgecolor='w',
                  orientation='portrait', papertype=None, format=None,
                  transparent=False, bbox_inches=None, pad_inches=0.1)

        The output formats available depend on the backend being used.

        Arguments:

          *fname*:
            A string containing a path to a filename, or a Python
            file-like object, or possibly some backend-dependent object
            such as :class:`~matplotlib.backends.backend_pdf.PdfPages`.

            If *format* is *None* and *fname* is a string, the output
            format is deduced from the extension of the filename. If
            the filename has no extension, the value of the rc parameter
            ``savefig.format`` is used.

            If *fname* is not a string, remember to specify *format* to
            ensure that the correct backend is used.

        Keyword arguments:

          *dpi*: [ *None* | ``scalar > 0`` ]
            The resolution in dots per inch.  If *None* it will default to
            the value ``savefig.dpi`` in the matplotlibrc file.

          *facecolor*, *edgecolor*:
            the colors of the figure rectangle

          *orientation*: [ 'landscape' | 'portrait' ]
            not supported on all backends; currently only on postscript output

          *papertype*:
            One of 'letter', 'legal', 'executive', 'ledger', 'a0' through
            'a10', 'b0' through 'b10'. Only supported for postscript
            output.

          *format*:
            One of the file extensions supported by the active
            backend.  Most backends support png, pdf, ps, eps and svg.

          *transparent*:
            If *True*, the axes patches will all be transparent; the
            figure patch will also be transparent unless facecolor
            and/or edgecolor are specified via kwargs.
            This is useful, for example, for displaying
            a plot on top of a colored background on a web page.  The
            transparency of these patches will be restored to their
            original values upon exit of this function.

          *bbox_inches*:
            Bbox in inches. Only the given portion of the figure is
            saved. If 'tight', try to figure out the tight bbox of
            the figure.

          *pad_inches*:
            Amount of padding around the figure when bbox_inches is
            'tight'.

          *bbox_extra_artists*:
            A list of extra artists that will be considered when the
            tight bbox is calculated.

        Rjssavefig.dpittransparentRctnoneRdssavefig.facecolorssavefig.edgecoloriiN(t
setdefaultRR�RsR>RoR�R�R�R�R�Rutprint_figuretzip(RR�R�RStoriginal_axes_colorsR�Rotcc((s7/usr/lib64/python2.7/site-packages/matplotlib/figure.pytsavefig�s&H	
cKs�|dkr|j�}n|jdt�}|dkr�|rit|t�ritj||�\}}q�tj||�\}}n|j	t�tj
|||�}|j|�|S(s�
        Create a colorbar for a ScalarMappable instance, *mappable*.

        Documentation for the pylab thin wrapper:
        %(colorbar_doc)s
        tuse_gridspecN(R)R*R�RFR1Rtcbartmake_axes_gridspect	make_axesR�tcolorbar_factoryR�(RtmappableR'R�tkwR[tcb((s7/usr/lib64/python2.7/site-packages/matplotlib/figure.pytcolorbarZs

cOs�|jj||�ddl}x�|jD]�}t||jj�s�|jdk	r�t|j|jj�r�|jj�|j	|jj
�q�|jdk	r�t|j|jj�r�|jj�|j	|jj
�q�q)|j�|j	|j
�q)WdS(s%
        Call signature::

          subplots_adjust(left=None, bottom=None, right=None, top=None,
                              wspace=None, hspace=None)

        Update the :class:`SubplotParams` with *kwargs* (defaulting to rc when
        *None*) and update the subplot locations

        i����N(RvRHtmatplotlib.axesR>R1Rt_sharexR)t
update_paramstset_positiontfigboxt_sharey(RR�R�R8R�((s7/usr/lib64/python2.7/site-packages/matplotlib/figure.pyR�ps'
'

iiicCs7t|d|d|d|�}|d|d|d|�S(s�
        Call signature::

          ginput(self, n=1, timeout=30, show_clicks=True,
                 mouse_add=1, mouse_pop=3, mouse_stop=2)

        Blocking call to interact with the figure.

        This will wait for *n* clicks from the user and return a list of the
        coordinates of each click.

        If *timeout* is zero or negative, does not timeout.

        If *n* is zero or negative, accumulate clicks until a middle click
        (or potentially both mouse buttons at once) terminates the input.

        Right clicking cancels last input.

        The buttons used for the various actions (adding points, removing
        points, terminating the inputs) can be overriden via the
        arguments *mouse_add*, *mouse_pop* and *mouse_stop*, that give
        the associated mouse button: 1 for left, 2 for middle, 3 for
        right.

        The keyboard can also be used to select points in case your mouse
        does not have one or more of the buttons.  The delete and backspace
        keys act like right clicking (i.e., remove last point), the enter key
        terminates input and any other key (not already used by the window
        manager) selects a point.
        t	mouse_addt	mouse_popt
mouse_stoptnttimeouttshow_clicks(R(RRmRnRoRjRkRltblocking_mouse_input((s7/usr/lib64/python2.7/site-packages/matplotlib/figure.pytginput�s
 	i����cCst|�}|d|�S(sd
        Call signature::

          waitforbuttonpress(self, timeout=-1)

        Blocking call to interact with the figure.

        This will return True is a key was pressed, False if a mouse
        button was pressed and None if *timeout* was reached without
        either being pressed.

        If *timeout* is negative, does not timeout.
        Rn(R(RRntblocking_input((s7/usr/lib64/python2.7/site-packages/matplotlib/figure.pytwaitforbuttonpress�scCsbg|jD]}|j�r
|^q
}x3|jD](}|j�r2|j|j��q2q2W|S(N(R�RR>R�tget_default_bbox_extra_artists(RR�tbbox_extra_artistsR�((s7/usr/lib64/python2.7/site-packages/matplotlib/figure.pyRt�s
(cCs�g}x6|jD]+}|j�r|j|j|��qqWtjg|D]*}|jdksp|jdkrL|^qL�}t|t	�j
d|j��}|S(s�
        Return a (tight) bounding box of the figure in inches.

        It only accounts axes title, axis labels, and axis
        ticklabels. Needs improvement.
        ig�?(R>RR�t
get_tightbboxRtunionRaRbRRR�Rj(RRtbbR�R�t_bboxRl((s7/usr/lib64/python2.7/site-packages/matplotlib/figure.pyRv�s@gH�z�G�?c
Cs�ddlm}m}m}||j�}	d|	krGtjd�n|dkrb||�}n|||j|	|d|d|d|d|�}
|j|
�dS(	sx
        Adjust subplot parameters to give specified padding.

        Parameters:

          *pad* : float
            padding between the figure edge and the edges of subplots,
            as a fraction of the font-size.
          *h_pad*, *w_pad* : float
            padding (height/width) between edges of adjacent subplots.
            Defaults to `pad_inches`.
          *rect* : if rect is given, it is interpreted as a rectangle
            (left, bottom, right, top) in the normalized figure
            coordinate that the whole subplots area (including
            labels) will fit into. Default is (0, 0, 1, 1).
        i����(tget_renderertget_tight_layout_figuretget_subplotspec_listsgThis figure includes Axes that are not compatible with tight_layout, so its results might be incorrect.tpadth_padtw_padR�N(	R|RzR{R|R>R)R5R6R�(RRR}R~RR�RzR{R|tsubplotspec_listR�((s7/usr/lib64/python2.7/site-packages/matplotlib/figure.pyR|�s	N(DRBRCRDR_R)RFRRR�tpropertyR>R�R�RjR�RwR�R�R�R�R�R�R�R�R�R�R�R�R�R�R�R�R�R�R�R�R�R�R�R�Rtdedent_interpdR�R�RsRyR�RR
RR�R!R�RqR*R�R,R9RQRRRZRcR�RqRsRtRvR|(((s7/usr/lib64/python2.7/site-packages/matplotlib/figure.pyR[�s�	E					&				$	D	#															PL	V			_	+				*		`	&		c	Cs�t|d�}tjd	�}tjd
�}|rY|jd \}}t|�|}nt|�}tdd}tj|||f�}|td||�:}|td||�:}tj|||�}|S(s;
    Create a figure with specified aspect ratio.  If *arg* is a number,
    use that aspect ratio.  If *arg* is an array, figaspect will
    determine the width and height for a figure that would fit array
    preserving aspect ratio.  The figure width, height in inches are
    returned.  Be sure to create an axes with equal with and height,
    eg

    Example usage::

      # make a figure twice as tall as it is wide
      w, h = figaspect(2.)
      fig = Figure(figsize=(w,h))
      ax = fig.add_axes([0.1, 0.1, 0.8, 0.8])
      ax.imshow(A, **kwargs)


      # make a figure with the proper aspect for an array
      A = rand(5,3)
      w, h = figaspect(A)
      fig = Figure(figsize=(w,h))
      ax = fig.add_axes([0.1, 0.1, 0.8, 0.8])
      ax.imshow(A, **kwargs)

    Thanks to Fernando Perez for this function
    tshapeg@g@g0@isfigure.figsizeig�?(g@g@(g0@g0@(	R�R�tarrayR�tfloatRtminRCtclip(	targtisarraytfigsize_mintfigsize_maxtnrtnct	arr_ratiot
fig_heighttnewsize((s7/usr/lib64/python2.7/site-packages/matplotlib/figure.pyt	figaspects(;RDt
__future__RR5toperatorRtnumpyR�R8RRRR0tmatplotlib.artisttartisttmartistRRtmatplotlib.cbookRfRRR	tmatplotlib.imageR
tmatplotlib.colorbarRcR\RdRRR
tmatplotlib.blocking_inputRRtmatplotlib.legendRtmatplotlib.patchesRtmatplotlib.projectionsRRtmatplotlib.textRRtmatplotlib.transformsRRRRtmatplotlib.backend_basesRtinterpdRHRRER[R�tkwdoc(((s7/usr/lib64/python2.7/site-packages/matplotlib/figure.pyt<module>
sB"dT�����!	>

Anon7 - 2021