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/matplotlib/gridspec.pyo
�
�)�Uc@ s�dZddlmZddlZejZddljZddlZ	de
fd��YZdefd��YZdefd	��YZ
d
e
fd��YZdS(s�
:mod:`~matplotlib.gridspec` is a module which specifies the location
of the subplot in the figure.

    ``GridSpec``
        specifies the geometry of the grid that a subplot will be
        placed. The number of rows and number of columns of the grid
        need to be set. Optionally, the subplot layout parameters
        (e.g., left, right, etc.) can be tuned.

    ``SubplotSpec``
        specifies the location of the subplot in the given *GridSpec*.


i����(tdivisionNtGridSpecBasecB sweZdZddd�Zd�Zdd�Zddd�Zd�Zd�Z	d�Z
d	�Zd
�Zd�Z
RS(
sm
    A base class of GridSpec that specifies the geometry of the grid
    that a subplot will be placed.
    cC s1|||_|_|j|�|j|�dS(s�
        The number of rows and number of columns of the grid need to
        be set. Optionally, the ratio of heights and widths of ros and
        columns can be specified.
        N(t_nrowst_ncolstset_height_ratiostset_width_ratios(tselftnrowstncolst
height_ratiostwidth_ratios((sF/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/gridspec.pyt__init__ s
cC s|j|jfS(s$get the geometry of the grid, eg 2,3(RR(R((sF/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/gridspec.pytget_geometry-scC sdS(N((Rtfig((sF/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/gridspec.pytget_subplot_params1sicC s4|\}}||||�|||�f}|S(s:
        create and return a SuplotSpec instance.
        ((Rtloctrowspantcolspantloc1tloc2tsubplotspec((sF/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/gridspec.pytnew_subplotspec4s$cC s
||_dS(N(t_col_width_ratios(RR
((sF/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/gridspec.pyR=scC s|jS(N(R(R((sF/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/gridspec.pytget_width_ratios@scC s
||_dS(N(t_row_height_ratios(RR	((sF/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/gridspec.pyRCscC s|jS(N(R(R((sF/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/gridspec.pytget_height_ratiosFsc!C s�|j�\}}|j|�}|j}|j}|j}|j}|j}	|j}
||}||}|||
|d}
|
|
}|jdk	r�|
|}t
t|j��}g|jD]}|||^q�}n
|
g|}dg|g|d}tj
jtjt||���}|||	|d}|	|}|jdk	r�||}t
t|j��}g|jD]}|||^q�}n
|g|}dg|g|d}tj
jtjt||���}gt|�D]}||d|^q�}gt|�D]}||d|d^q}gt|�D]}||d|^qN}gt|�D]}||d|d^qy} |||| fS(so
        return lists of bottom and top position of rows, left and
        right positions of columns.
        iiiN(RRtlefttrighttbottomttoptwspacethspaceRtNonetfloattsumtnptaddt
accumulatetraveltzipRtrange(!RR
RRtsubplot_paramsRRRRRRttotWidtht	totHeighttcellHtsepHt	netHeightttrtrtcellHeightst
sepHeightstcellHstcellWtsepWtnetWidtht
cellWidthst	sepWidthstcellWstrowNumtfigTopst
figBottomstcolNumtfigLeftst	figRights((sF/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/gridspec.pytget_grid_positionsJsB						



'
$

'
$+/+/cC s�|j�\}}||}t|t�r*y|\}}Wntk
rZtd��nXt|t�r�|j|�\}}}	n*|dkr�||7}n||d}}t|t�r�|j|�\}
}}	n*|dkr�||7}n||d}
}|||
}|d||d}
nZt|t�r^|j|�\}}
}	|
d8}
n&|dkrw||7}n|d}}
t|||
�S(s:
        create and return a SuplotSpec instance.
        sunrecognized subplot speciiN(Rt
isinstancettuplet
ValueErrortslicetindicesR tSubplotSpec(RtkeyRRttotaltk1tk2trow1trow2t_tcol1tcol2tnum1tnum2((sF/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/gridspec.pyt__getitem__�s4






N(t__name__t
__module__t__doc__R RRRRRRRRR@RR(((sF/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/gridspec.pyRs							9tGridSpecc	B s\eZdZd
d
d
d
d
d
d
d
d�ZddddddgZd�Zd
d	�ZRS(s�
    A class that specifies the geometry of the grid that a subplot
    will be placed. The location of grid is determined by similar way
    as the SubplotParams.
    cC sY||_||_||_||_||_||_tj|||d|	d|
�dS(s�
        The number of rows and number of columns of the
        grid need to be set. Optionally, the subplot layout parameters
        (e.g., left, right, etc.) can be tuned.
        R
R	N(RRRRRRRR(RRRRRRRRRR
R	((sF/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/gridspec.pyR�s
						RRRRRRcK saxO|j�D]A\}}||jkr;t|||�q
td|f��q
Wddlm}ddlm}x�|jj	j
�D]�}x�|jjj
D]�}t||�s;|jdk	r�t|j|�r�|jj�|j|jj�qU|jdk	rUt|j|�rU|jj�|j|jj�qUq�|j�|j|j�q�Wq�WdS(s�
        Update the current values.  If any kwarg is None, default to
        the current value, if set, otherwise to rc.
        s%s is unknown keywordi����(t_pylab_helpers(tSubplotBaseN(titemst_AllowedKeystsetattrtAttributeErrort
matplotlibRWtmatplotlib.axesRXtGcftfigstvaluestcanvastfiguretaxesRAt_sharexR t
update_paramstset_positiontfigboxt_sharey(RtkwargstktvRWRXt
figmanagertax((sF/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/gridspec.pytupdate�s"!
!

cC s�ddlm}ddl}|dkrgtg|jD]}|td|f^q5�}||�}n|j|j�}tg|jD]}|t||�f^q��}|j	|�|S(s�
        return a dictionary of subplot layout parameters. The default
        parameters are from rcParams unless a figure attribute is set.
        i����(t
SubplotParamsNsfigure.subplot.(
tmatplotlib.figureRptcopyR tdictRZtrcParamstsubplotparstgetattrRo(RR
RpRrRktkwRut	update_kw((sF/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/gridspec.pyR�s*1
N(RSRTRUR RRZRoR(((sF/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/gridspec.pyRV�s	 tGridSpecFromSubplotSpeccB s/eZdZddddd�Zdd�ZRS(sx
    GridSpec whose subplot layout parameters are inherited from the
    location specified by a given SubplotSpec.
    cC s>||_||_||_tj|||d|d|�dS(s`
        The number of rows and number of columns of the grid need to
        be set. An instance of SubplotSpec is also needed to be set
        from which the layout parameters will be inheirted. The wspace
        and hspace of the layout can be optionally specified or the
        default values (from the figure or rcParams) will be used.
        R
R	N(t_wspacet_hspacet
_subplot_specRR(RRRtsubplot_specRRR	R
((sF/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/gridspec.pyRs			c
C s�|dkr#td}td}n|jj}|jj}|jdk	rV|j}n|jdk	rq|j}n|jj|dt	�}|j
\}}}}ddlm}	|	d|d|d|d	|d
|d|�}
|
S(
sC
        return a dictionary of subplot layout parameters.
        sfigure.subplot.hspacesfigure.subplot.wspacet
return_alli����(RpRRRRRRN(
R RtRuRRR{RzR|tget_positiontFalsetextentsRqRp(RR
RRRhRRRRRptsp((sF/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/gridspec.pyR s&

	N(RSRTRUR RR(((sF/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/gridspec.pyRysRFcB s8eZdZdd�Zd�Zd�Zed�ZRS(sH
    specifies the location of the subplot in the given *GridSpec*.
    cC s;|j�\}}||}||_||_||_dS(s�
        The subplot will occupy the num1-th cell of the given
        gridspec.  If num2 is provided, the subplot will span between
        num1-th cell and num2-th cell.

        The index stars from 0.
        N(Rt	_gridspecRPRQ(RtgridspecRPRQtrowstcolsRH((sF/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/gridspec.pyRHs
	
		cC s|jS(N(R�(R((sF/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/gridspec.pytget_gridspecXscC s.|j�j�\}}|||j|jfS(sc
        get the subplot geometry, eg 2,2,3. Unlike SuplorParams,
        index is 0-based
        (R�RRPRQ(RR�R�((sF/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/gridspec.pyR\scC sC|j�}|j�\}}|j|�\}}}}	t|j|�\}
}||
}||
}
||}|	|}|jdk	rt|j|�\}}||}||}||}|	|}t||�}t||�}t|
|�}
t||�}nt	j
j||||
�}|r;||
|||fS|SdS(sB
        update the subplot position from fig.subplotpars
        N(R�RR@tdivmodRPRQR tmintmaxtmtransformstBboxtfrom_extents(RR
R~R�RRR<R;R>R?R:R=t	figBottomtfigToptfigLefttfigRighttrowNum2tcolNum2t
figBottom2tfigTop2tfigLeft2t	figRight2Rh((sF/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/gridspec.pyRes.







N(	RSRTRUR RR�RR�R(((sF/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/gridspec.pyRFCs
			(RUt
__future__RR]Rttmatplotlib.transformst
transformsR�tnumpyR#tobjectRRVRyRF(((sF/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/gridspec.pyt<module>s	�U=