HEX
Server: LiteSpeed
System: Linux standart9.isimtescil.net 3.10.0-962.3.2.lve1.5.26.7.el7.x86_64 #1 SMP Wed Oct 2 07:53:12 EDT 2019 x86_64
User: karalev (5310)
PHP: 8.2.29
Disabled: NONE
Upload Files
File: //opt/alt/python27/lib64/python2.7/site-packages/mpl_toolkits/axes_grid1/axes_divider.pyo
�
[�3Lc@sdZddljZddlmZddlZddlZde	fd��YZ
de	fd��YZde
fd	��YZd
e
fd��YZ
ddd
��YZiZd�Zd�ZddlmZee�Zd�Zd�Zd�Zedkre�e�ndS(s
The axes_divider module provide helper classes to adjust the positions of
multiple axes at the drawing time.

 Divider: this is the class that is used calculates the axes
    position. It divides the given renctangular area into several sub
    rectangles. You intialize the divider by setting the horizontal
    and vertical list of sizes that the division will be based on. You
    then use the new_locator method, whose return value is a callable
    object that can be used to set the axes_locator of the axes.

i����N(tSubplotBasetDividercBs�eZdZddd�Zed��Zed��Zd�Zd�Z	d�Z
d�Zd	�Zd
�Z
d�Zd�Zed
�Zd�Zdddd�Zddd�ZRS(s�
    This is the class that is used calculates the axes position. It
    divides the given renctangular area into several
    sub-rectangles. You intialize the divider by setting the
    horizontal and vertical lists of sizes
    (:mod:`mpl_toolkits.axes_grid.axes_size`) that the division will
    be based on. You then use the new_locator method to create a
    callable object that can be used to as the axes_locator of the
    axes.
    tCcCsL||_||_||_||_||_||_d|_d|_dS(s�
        :param fig: matplotlib figure
        :param pos: position (tuple of 4 floats) of the rectangle that
                    will be divided.
        :param horizontal: list of sizes
                    (:mod:`~mpl_toolkits.axes_grid.axes_size`)
                    for horizontal division
        :param vertical: list of sizes
                    (:mod:`~mpl_toolkits.axes_grid.axes_size`)
                    for vertical division
        :param aspect: if True, the overall rectalngular area is reduced
                    so that the relative part of the horizontal and
                    vertical scales have same scale.
        :param anchor: Detrmine how the reduced rectangle is placed
                       when aspect is True,
        iN(t_figt_post_horizontalt	_verticalt_anchort_aspectt
_xrefindext
_yrefindex(tselftfigtpost
horizontaltverticaltaspecttanchor((sW/opt/alt/python27/lib64/python2.7/site-packages/mpl_toolkits/axes_grid1/axes_divider.pyt__init__$s							c	Csld\}}x7|D]/}|j|�\}}||7}||7}qW|dkrd|||}|SdSdS(Ng(gg(tget_size(	tlt
total_sizetrenderertrs_sumtas_sumtst_rst_astk((sW/opt/alt/python27/lib64/python2.7/site-packages/mpl_toolkits/axes_grid1/axes_divider.pyt_calc_k@s

cCsPdg}x@|D]8}|j|�\}}|j|d|||�qW|S(Ngi����(Rtappend(RRRtoffsetsRRR((sW/opt/alt/python27/lib64/python2.7/site-packages/mpl_toolkits/axes_grid1/axes_divider.pyt
_calc_offsetsQs
	
!cCs
||_dS(s�
        set the position of the rectangle.

        :param pos: position (tuple of 4 floats) of the rectangle that
                    will be divided.
        N(R(RR
((sW/opt/alt/python27/lib64/python2.7/site-packages/mpl_toolkits/axes_grid1/axes_divider.pytset_position]scCs|jS(s%return the position of the rectangle.(R(R((sW/opt/alt/python27/lib64/python2.7/site-packages/mpl_toolkits/axes_grid1/axes_divider.pytget_positionfscCs_|tjjj�ks*t|�dkr6||_n%tddjtjjj����dS(s�
        :param anchor: anchor position

          =====  ============
          value  description
          =====  ============
          'C'    Center
          'SW'   bottom left
          'S'    bottom
          'SE'   bottom right
          'E'    right
          'NE'   top right
          'N'    top
          'NW'   top left
          'W'    left
          =====  ============

        isargument must be among %ss, N(	tmtransformstBboxtcoefstkeystlenRt
ValueErrortjointBBox(RR((sW/opt/alt/python27/lib64/python2.7/site-packages/mpl_toolkits/axes_grid1/axes_divider.pyt
set_anchorjs*cCs|jS(sreturn the anchor(R(R((sW/opt/alt/python27/lib64/python2.7/site-packages/mpl_toolkits/axes_grid1/axes_divider.pyt
get_anchor�scCs
||_dS(s�
        :param horizontal: list of sizes
                    (:mod:`~mpl_toolkits.axes_grid.axes_size`)
                    for horizontal division
        N(R(Rth((sW/opt/alt/python27/lib64/python2.7/site-packages/mpl_toolkits/axes_grid1/axes_divider.pytset_horizontal�scCs|jS(sreturn horizontal sizes(R(R((sW/opt/alt/python27/lib64/python2.7/site-packages/mpl_toolkits/axes_grid1/axes_divider.pytget_horizontal�scCs
||_dS(s�
        :param horizontal: list of sizes
                    (:mod:`~mpl_toolkits.axes_grid.axes_size`)
                    for horizontal division
        N(R(Rtv((sW/opt/alt/python27/lib64/python2.7/site-packages/mpl_toolkits/axes_grid1/axes_divider.pytset_vertical�scCs|jS(sreturn vertical sizes(R(R((sW/opt/alt/python27/lib64/python2.7/site-packages/mpl_toolkits/axes_grid1/axes_divider.pytget_vertical�scCs
||_dS(s.
        :param anchor: True or False
        N(R(RR((sW/opt/alt/python27/lib64/python2.7/site-packages/mpl_toolkits/axes_grid1/axes_divider.pyt
set_aspect�scCs|jS(s
return aspect(R(R((sW/opt/alt/python27/lib64/python2.7/site-packages/mpl_toolkits/axes_grid1/axes_divider.pyt
get_aspect�scCs|jj�\}}|j�\}}	}
}|j|j||
|�}|j|j|||�}
|j�r@t||
�}|j|j||�}|j|j||�}|d|d|}|d|d|}t	j
j||	|
|�}t	j
j||	||�}|j|j
�|�}|j|j}}n=|j|j||�}|j|j|
|�}||	}}|dkr�|d}n|dkr�|d}n|||||||||}}|||||||||}}t	j
j||||�S(sT

        :param nx, nx1: Integers specifying the column-position of the
          cell. When nx1 is None, a single nx-th column is
          specified. Otherwise location of columns spanning between nx
          to nx1 (but excluding nx1-th column) is specified.

        :param ny, ny1: same as nx and nx1, but for row positions.
        i����iiN(Rtget_size_inchesR"RRRR4tminR R#R$tfrom_boundstanchoredR,tx0ty0tNone(Rtnxtnytnx1tny1RtfigWtfigHtxtytwR-tk_htk_vRtoxtoytwwthhtpbtpb1tpb1_anchoredR9R:tx1tw1ty1th1((sW/opt/alt/python27/lib64/python2.7/site-packages/mpl_toolkits/axes_grid1/axes_divider.pytlocate�s0


))cCst|||||�S(s�
        returns a new locator
        (:class:`mpl_toolkits.axes_grid.axes_divider.AxesLocator`) for
        specified cell.

        :param nx, nx1: Integers specifying the column-position of the
          cell. When nx1 is None, a single nx-th column is
          specified. Otherwise location of columns spanning between nx
          to nx1 (but excluding nx1-th column) is specified.

        :param ny, ny1: same as nx and nx1, but for row positions.
        (tAxesLocator(RR<R=R>R?((sW/opt/alt/python27/lib64/python2.7/site-packages/mpl_toolkits/axes_grid1/axes_divider.pytnew_locator�s
N(t__name__t
__module__t__doc__R;RtstaticmethodRR R!R"R+R,R.R/R1R2tFalseR3R4RRRT(((sW/opt/alt/python27/lib64/python2.7/site-packages/mpl_toolkits/axes_grid1/axes_divider.pyRs 
											/RScBs&eZdZddd�Zd�ZRS(s}
    A simple callable object, initiallized with AxesDivider class,
    returns the position and size of the given cell.
    cCs�||_|j}|j}|||||_|_|dkrO|d}n|dkrh|d}n|||_|||_dS(s�
        :param axes_divider: An instance of AxesDivider class.

        :param nx, nx1: Integers specifying the column-position of the
          cell. When nx1 is None, a single nx-th column is
          specified. Otherwise location of columns spanning between nx
          to nx1 (but excluding nx1-th column) is is specified.

        :param ny, ny1: same as nx and nx1, but for row positions.
        iN(t
_axes_dividerR	R
t_nxt_nyR;t_nx1t_ny1(Rtaxes_dividerR<R=R>R?R	R
((sW/opt/alt/python27/lib64/python2.7/site-packages/mpl_toolkits/axes_grid1/axes_divider.pyR�s			


cCsP|jj}|jj}|jj|j||j||j||j||�S(N(RZR	R
RRR[R\R]R^(RtaxesRR	R
((sW/opt/alt/python27/lib64/python2.7/site-packages/mpl_toolkits/axes_grid1/axes_divider.pyt__call__s


N(RURVRWR;RRa(((sW/opt/alt/python27/lib64/python2.7/site-packages/mpl_toolkits/axes_grid1/axes_divider.pyRS�stSubplotDividercBs)eZdZd�Zd�Zd�ZRS(sT
    The Divider class whose rectangle area is specified as a subplot grometry.
    c
Os}||_t|�dkrgt|d�}t|�dkrLtd��ntt|�\}}}n0t|�dkr�|\}}}ntd��||}|d8}||kr�td��n||_||_||_|j	�|j
j}	|jdg�}
|jdg�}|jd	d
�}|jd
d�}
|rTtd��ntj|||	|
|d	|d
|
�d
S(s
        *fig* is a :class:`matplotlib.figure.Figure` instance.

        *args* is the tuple (*numRows*, *numCols*, *plotNum*), where
        the array of subplots in the figure has dimensions *numRows*,
        *numCols*, and where *plotNum* is the number of the subplot
        being created.  *plotNum* starts at 1 in the upper left
        corner and increases to the right.

        If *numRows* <= *numCols* <= *plotNum* < 10, *args* can be the
        decimal integer *numRows* * 100 + *numCols* * 10 + *plotNum*.
        iiis+Argument to subplot must be a 3 digits longsIllegal argument to subplots%Subplot number exceeds total subplotsRRRRRtN(tfigureR'tstrR(tmaptintt_rowst_colst_numt
update_paramstfigboxtboundstpopR;t	ExceptionRR(RRtargstkwargsRtrowstcolstnumttotalR
RRRR((sW/opt/alt/python27/lib64/python2.7/site-packages/mpl_toolkits/axes_grid1/axes_divider.pyRs4	

			
cCs|j�|jjS(s$return the bounds of the subplot box(RkRlRm(R((sW/opt/alt/python27/lib64/python2.7/site-packages/mpl_toolkits/axes_grid1/axes_divider.pyR"Rs
cCs|j}|j}|j}|jj}|j}|j}|j}|j}|j	}	|j
}
||}||}|||
|d}
|
|
}|||	|d}|	|}t||�\}}||d|
||}||||}tj
j||||
�|_dS(s0update the subplot position from fig.subplotparsiN(RhRiRjRdtsubplotparstlefttrighttbottomttoptwspacethspacetdivmodR#R$R7Rl(RRrRsRttparsRwRxRyRzR{R|ttotWidtht	totHeightRAtsepHR@tsepWtrowNumtcolNumt	figBottomtfigLeft((sW/opt/alt/python27/lib64/python2.7/site-packages/mpl_toolkits/axes_grid1/axes_divider.pyRkXs*									



(RURVRWRR"Rk(((sW/opt/alt/python27/lib64/python2.7/site-packages/mpl_toolkits/axes_grid1/axes_divider.pyRbs	3	tAxesDividercBsheZdZd�Zd�Zd	ed�Zd	ed�Zd	e	d�Z
d�Zd�Zd�Z
RS(
s1
    Divider based on the pre-existing axes.
    cCst||_tj|�|_tj|�|_tj|d|j�ddd|jgd|jgdddd�dS(	s#
        :param axes: axes
        RR
RRRRRN(
t_axestSizetAxesXt_xreftAxesYt_yrefRRt
get_figureR;(RR`((sW/opt/alt/python27/lib64/python2.7/site-packages/mpl_toolkits/axes_grid1/axes_divider.pyR}s	cKsy|j}|jdd�}|dkrQt|t�rB|j}qQt|�}n||j�|jdt	�|�}|S(Nt
axes_classtoriginal(
R�RnR;t
isinstanceRt_axes_classttypeR�R"tTrue(RRqR`R�tax((sW/opt/alt/python27/lib64/python2.7/site-packages/mpl_toolkits/axes_grid1/axes_divider.pyt
_get_new_axes�s	cKs6|rqt|tj�s3tj|d|j�}n|r^|jjd|�|jd7_qq|jj|�nt|tj�s�tj|d|j�}n|r�|jjd|�|jd7_|j	dddd�}n5|jj|�|j	dt
|j�ddd�}|j|�}|j|�|S(s�
        Add a new axes on the right (or left) side of the main axes.

        :param size: A width of the axes. A :mod:`~mpl_toolkits.axes_grid.axes_size`
          instance or if float or string is given, *from_any*
          fucntion is used to create one, with *ref_size* set to AxesX instance
          of the current axes.
        :param pad: pad between the axes. It takes same argument as *size*.
        :param pack_start: If False, the new axes is appended at the end
          of the list, i.e., it became the right-most axes. If True, it is
          inseted at the start of the list, and becomes the left-most axes.

        All extra keywords argument is passed to when creating a axes.
        if *axes_class* is given, the new axes will be created as an
        instance of the given class. Otherwise, the same class of the
        main axes will be used.  if Not provided

        tfraction_refiiR<R=(
R�R�t_Basetfrom_anyR�RtinsertR	RRTR'R�tset_axes_locator(Rtsizetpadt
pack_startRqtlocatorR�((sW/opt/alt/python27/lib64/python2.7/site-packages/mpl_toolkits/axes_grid1/axes_divider.pytnew_horizontal�s(%
cKs6|rqt|tj�s3tj|d|j�}n|r^|jjd|�|jd7_qq|jj|�nt|tj�s�tj|d|j�}n|r�|jjd|�|jd7_|j	dddd�}n5|jj|�|j	dddt
|j�d�}|j|�}|j|�|S(s�
        Add a new axes on the top (or bottom) side of the main axes.

        :param size: A height of the axes. A :mod:`~mpl_toolkits.axes_grid.axes_size`
          instance or if float or string is given, *from_any*
          fucntion is used to create one, with *ref_size* set to AxesX instance
          of the current axes.
        :param pad: pad between the axes. It takes same argument as *size*.
        :param pack_start: If False, the new axes is appended at the end
          of the list, i.e., it became the top-most axes. If True, it is
          inseted at the start of the list, and becomes the bottom-most axes.

        All extra keywords argument is passed to when creating a axes.
        if *axes_class* is given, the new axes will be created as an
        instance of the given class. Otherwise, the same class of the
        main axes will be used.  if Not provided

        R�iiR<R=(
R�R�R�R�R�RR�R
RRTR'R�R�(RR�R�R�RqR�R�((sW/opt/alt/python27/lib64/python2.7/site-packages/mpl_toolkits/axes_grid1/axes_divider.pytnew_vertical�s(%
cKs�|dkr*|j||dt|�}n�|dkrT|j||dt|�}n`|dkr~|j||dt|�}n6|dkr�|j||dt|�}ntd��|r�|jj|�n|S(s�
        create an axes at the given *position* with the same height
        (or width) of the main axes.

         *position*
           ["left"|"right"|"bottom"|"top"]

         *size* and *pad* should be axes_grid.axes_size compatible.
        RwR�RxRyRzs7the position must be one of left, right, bottom, or top(R�R�RYR�R(Rtadd_axes(RtpositionR�R�t
add_to_figureRqR�((sW/opt/alt/python27/lib64/python2.7/site-packages/mpl_toolkits/axes_grid1/axes_divider.pytappend_axes�scCs@|jdkr5|jj�}|dkr.tStSn|jSdS(Ntauto(RR;R�R4RYR�(RR((sW/opt/alt/python27/lib64/python2.7/site-packages/mpl_toolkits/axes_grid1/axes_divider.pyR4scCs6|jdkr+|jjdt�}|jS|jSdS(NR�(RR;R�R"R�Rm(Rtbbox((sW/opt/alt/python27/lib64/python2.7/site-packages/mpl_toolkits/axes_grid1/axes_divider.pyR"scCs'|jdkr|jj�S|jSdS(N(RR;R�R,(R((sW/opt/alt/python27/lib64/python2.7/site-packages/mpl_toolkits/axes_grid1/axes_divider.pyR,$s
N(RURVRWRR�R;RYR�R�R�R�R4R"R,(((sW/opt/alt/python27/lib64/python2.7/site-packages/mpl_toolkits/axes_grid1/axes_divider.pyR�xs		/0	
	tLocatableAxesBasecBs>eZd�Zd�Zd�Zdd�Zded�ZRS(cOs,|jj|||�d|_d|_dS(N(R�RR;t_locatort_locator_renderer(Rtkltkw((sW/opt/alt/python27/lib64/python2.7/site-packages/mpl_toolkits/axes_grid1/axes_divider.pyR-s	cCs
||_dS(N(R�(RR�((sW/opt/alt/python27/lib64/python2.7/site-packages/mpl_toolkits/axes_grid1/axes_divider.pyR�4scCs|jS(N(R�(R((sW/opt/alt/python27/lib64/python2.7/site-packages/mpl_toolkits/axes_grid1/axes_divider.pytget_axes_locator7scCsZ|j�dkr(|jj||�n.|j�||j�}|jj|d|�dS(NR�(R�R;R�tapply_aspectR�(RR�R
((sW/opt/alt/python27/lib64/python2.7/site-packages/mpl_toolkits/axes_grid1/axes_divider.pyR�:scCs#||_|jj|||�dS(N(R�R�tdraw(RRtinframe((sW/opt/alt/python27/lib64/python2.7/site-packages/mpl_toolkits/axes_grid1/axes_divider.pyR�Cs	N(	RURVRR�R�R;R�RYR�(((sW/opt/alt/python27/lib64/python2.7/site-packages/mpl_toolkits/axes_grid1/axes_divider.pyR�,s
				cCsUtj|�}|dkrQtjd|jt|fi|d6�}|t|<n|S(NsLocatable%sR�(t_locatableaxes_classestgetR;tnewtclassobjRUR�(R�t	new_class((sW/opt/alt/python27/lib64/python2.7/site-packages/mpl_toolkits/axes_grid1/axes_divider.pytlocatable_axes_factoryLs	
cCsbt|d�s-tt|��}||_nt|�}|jdddd�}|j|�|S(NR�R<iR=(thasattrR�R�t	__class__R�RTR�(R`R�tdividerR�((sW/opt/alt/python27/lib64/python2.7/site-packages/mpl_toolkits/axes_grid1/axes_divider.pytmake_axes_locatable[s
(tAxescCs�d}d}ddl}|jdd|�}|jd	d
|�}|j||�\}}ddlj}|j||dddd�}|j||d
ddd�}	||	d}
|
|fS(Ng�?i����ii����ii����g�g/�$@g�g5^�I@g�?gg�?ii
(i����ii����i(tnumpytarangetmeshgridtmatplotlib.mlabtmlabtbivariate_normal(tdeltatextenttnpRBRCtXtYR�tZ1tZ2tZ((sW/opt/alt/python27/lib64/python2.7/site-packages/mpl_toolkits/axes_grid1/axes_divider.pytget_demo_imagemscCs.ddlj}|jdd�}|j�|jddd�}t�\}}|j|d|dd�}|j|�}|j|j	j
�dt�t|dddd	t
�}t||j��}t||j��}tj|�tjd
�tjd�g}	tj|�g}
|j|	�|j|
�|j|jdd
dd
��|j|jdddd
��|j|�|j|�|jjd�t�\}}|j|d|dd�}|j|d|�|j|j
�dt�|j�|jddd�}t|�}|jdddd
�}|j|�|j|d|dd�}|j|d|�|j|j
�dt�|jddd�}t|�}|jdddd
�}|j|�|j|d|dd�|j|d|dd�|j|j
�dt�|j�|j�dS(Ni����iiiR�t
interpolationtnearesttvisibleRg�������?g�������?R<iR=RxtcaxiR�s5%R�is100%(ii(tmatplotlib.pyplottpyplotRdtclftadd_subplotR�timshowtcolorbartsetpR�tget_yticklabelsRYRbR�t
LocatableAxesR"R�R�tFixedR�R.R1R�RTR�tyaxistset_ticks_positionR�R�R�tshow(tplttfig1R�R�R�timtcbR�tax_cbR-R0tax2((sW/opt/alt/python27/lib64/python2.7/site-packages/mpl_toolkits/axes_grid1/axes_divider.pytdemo_locatable_axes}sV








cCs�ddlj}|jdd�}tjd�tjd�g}tjd�tjd�g}t|d||d	t�}t||j��}|j	|j
d
ddd��|j|�|jddd
g�|j
�|j�dS(Ni����iig�?g@gffffff�?g@gRR<iR=i(ii(ggg�?g�?(R�R�RdR�R�RRYR�R"R�RTR�tplotR�R�(R�tfig2R-R0R�R�((sW/opt/alt/python27/lib64/python2.7/site-packages/mpl_toolkits/axes_grid1/axes_divider.pytdemo_fixed_size_axes�s

t__main__((RWtmatplotlib.transformst
transformsR#tmatplotlib.axesRR�t	axes_sizeR�tobjectRRSRbR�R�R�R�R�tmpl_axesR�R�R�R�R�RU(((sW/opt/alt/python27/lib64/python2.7/site-packages/mpl_toolkits/axes_grid1/axes_divider.pyt<module>s(�-_�		
		X