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/table.pyo
�
�)�Uc
@ s
dZddlmZddlZddlZddlmZmZddlmZddl	m
Z
ddlmZddl
mZdd	lmZd
efd��YZdefd
��YZeedeeedeedded�Zejjdeje��dS(sG
Place a table below the x-axis at location loc.

The table consists of a grid of cells.

The grid need not be rectangular and can have holes.

Cells are added by specifying their row and column.

For the purposes of positioning the cell at (0, 0) is
assumed to be at the top left and the cell at (max_row, max_col)
is assumed to be at bottom right.

You can add additional cells outside this range to have convenient
ways of positioning more interesting grids.

Author    : John Gill <jng@europe.renre.com>
Copyright : 2004 John Gill and John Hunter
License   : matplotlib license

i����(tdivisionN(tArtisttallow_rasterization(t	Rectangle(tis_string_like(t	docstring(tText(tBboxtCellcB s�eZdZdZddedddd�Zd�Zd�Zd�Z	d	�Z
d
�Zd�Ze
d��Zd
�Zd�Zd�Zd�ZRS(s;
    A cell is a Rectangle with some associated text.

    g�������?tktwtc

C s�tj||d|d|d|d|�|jt�|dkrJd}n||_td|dd|d	d
|d|	�|_|jjt�dS(Ntwidththeightt	edgecolort	facecolortrighttxityittexttfontproperties(Rt__init__tset_clip_ontFalsetNonet_locRt_text(
tselftxyRR
RRtfillRtlocR((sC/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/table.pyR*s	

		 cC stj||�dS(N(Rt
set_transform(Rttrans((sC/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/table.pyR@scC s$tj||�|jj|�dS(N(Rt
set_figureR(Rtfig((sC/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/table.pyR!DscC s|jS(sReturn the cell Text intance(R(R((sC/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/table.pytget_textHscC s|jj|�dS(N(Rtset_fontsize(Rtsize((sC/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/table.pyR$LscC s
|jj�S(sReturn the cell fontsize(Rtget_fontsize(R((sC/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/table.pyR&OscC sj|j�}|j|�}xH|dkre||j�kre|d8}|j|�|j|�}qW|S(s# Shrink font size until text fits. i(R&tget_required_widtht	get_widthR$(Rtrenderertfontsizetrequired((sC/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/table.pytauto_set_font_sizeSs!

cC sA|j�sdStj||�|j|�|jj|�dS(N(tget_visibleRtdrawt_set_text_positionR(RR)((sC/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/table.pyR.^s

c	C s�|j|�}|j\}}}}|jjd�||d}|jdkrr|jjd�||d}nX|jdkr�|jjd�|||j}n%|jjd�||d|j}|jj||f�dS(sm Set text up so it draws in the right place.

        Currently support 'left', 'center' and 'right'
        tcenterg@tleftRg�?N(tget_window_extenttboundsRtset_verticalalignmentRtset_horizontalalignmenttPADtset_position(	RR)tbboxtltbR
thRR((sC/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/table.pyR/hscC s.|jj|�}|j|j��}|jS(s' Get text bounds in axes co-ordinates. (RR2tinverse_transformedtget_data_transformR3(RR)R8tbboxa((sC/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/table.pytget_text_bounds�scC s.|j|�\}}}}|dd|jS(s# Get width required for this cell. g�?g@(R?R6(RR)R9R:R
R;((sC/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/table.pyR'�scK s|jj|�dS(s&update the text properties with kwargsN(Rtupdate(Rtkwargs((sC/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/table.pytset_text_props�sN(t__name__t
__module__t__doc__R6tTrueRRRR!R#R$R&R,RR.R/R?R'RB(((sC/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/table.pyR#s$						
			tTablecB sUeZdZidd6dd6dd6dd6d	d
6dd6d
d6dd6dd6dd6dd6dd6dd6dd6dd6dd 6d!d"6d#d$6ZdZd%Zd8d8d&�Zd'�Zd(�Z	e
d)��Zd*�Zd+�Z
d,�ZeZd-�Zd.�Zd/�Zd0�Zed1�Zd2�Zd3�Zd4�Zd5�Zd6�Zd7�ZRS(9s7
    Create a table of cells.

    Table can have (optional) row and column headers.

    Each entry in the table can be either text or patches.

    Column widths and row heights for the table can be specifified.

    Return value is a sequence of text, line and patch instances that make
    up the table
    itbestisupper rightis
upper leftis
lower leftislower rightiscenter leftiscenter rightislower centerisupper centeri	R0i
s	top rightistop leftisbottom lefti
sbottom rightiRiR1ittopitbottomg{�G�z�?cC s�tj|�t|�rZ||jkrZtjd|dj|jj��f�d}nt|�r~|jj|d�}n|j	|j
�||_||_||_
|j|j�g|_i|_g|_g|_t|_d|_dS(NsIUnrecognized location %s. Falling back on bottom; valid locations are
%s	s
	RJi(RRRtcodestwarningstwarntjointkeystgetR!tfiguret_axesRt_bboxRt	transAxest_textst_cellst	_autoRowst_autoColumnsRFt
_autoFontsizeRt_cachedRenderer(RtaxRR8((sC/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/table.pyR�s"
)									cO s_d}t|||�}|j|j�|j|j��|jt�||j||f<dS(s Add a cell to the table. iN(ii(RR!RQRt
get_transformRRRV(RtrowtcoltargsRARtcell((sC/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/table.pytadd_cell�s
cC s&|jd|jj|jjjdS(NgR@g333333�?(tFONTSIZERQtdpiRRR8R
(R((sC/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/table.pyt_approx_text_height�scC s�|dkr|j}n|dkr3td��n||_|j�sLdS|jd�|j|�|jj�}|j�x"|D]}|j|j	|�q�W|j
d�dS(NsNo renderer definedttable(RRZtRuntimeErrorR-t
open_groupt_update_positionsRVROtsortR.tclose_group(RR)ROtkey((sC/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/table.pyR.�s	



cC stg|jj�D]<}|ddkr|ddkr|j|j|�^q}tj|�}|j|j��S(srGet a bbox, in axes co-ordinates for the cells.

        Only include those in the range (0,0) to (maxRow, maxCol)ii(RVROR2RtunionR<R\(RR)tpostboxesR8((sC/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/table.pyt_get_grid_bbox�s
<cC s�t|j�r|j||�S|jdk	r�g|jj�D]?}|ddkr>|ddkr>|j|j|j�^q>}t|�}|j|j	|j
�ifStifSdS(sUTest whether the mouse event occurred in the table.

        Returns T/F, {}
        iiN(tcallablet	_containsRZRRVROR2tbbox_alltcontainsRRR(Rt
mouseeventRmRnR8((sC/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/table.pyRs�s?cC s
|jj�S(s)Return the Artists contained by the table(RVtvalues(R((sC/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/table.pytget_childrenscC s/g|jD]}|j|�^q
}t|�S(s5Return the bounding box of the table in window coords(RVR2Rr(RR)tcRn((sC/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/table.pyR2s%cC sti}i}xy|jj�D]h\\}}}|j|d�}t||j��||<|j|d�}t||j��||<qWd}i}	|j�}
|
j�x&|
D]}||	|<|||7}q�Wd}i}|j�}
|
j�|
j�x&|
D]}|||<|||7}qWxE|jj�D]4\\}}}|j	|	|�|j
||�q8WdS(sW Calculate row heights and column widths.

        Position cells accordingly.
        giN(RVt	iteritemst
setdefaulttmaxt
get_heightR(RORitreversetset_xtset_y(RtwidthstheightsR]R^R`R
Rtxpostleftstcolstypostbottomstrows((sC/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/table.pyt_do_cell_alignments2"






"cC s|jj|�dS(N(RXtappend(RR^((sC/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/table.pytauto_set_column_width=scC s�g|jD]}|d|kr
|^q
}d}x3|D]+}|j|}t|j|�|�}q9Wx"|D]}|j|j|�qoWdS(s- Automagically set width for column.
        iiN(RVRzR't	set_width(RR^R)RktcellsRR`Rw((sC/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/table.pyt_auto_set_column_widthAs,


cC s
||_dS(s Automatically set font size. N(RY(Rtvalue((sC/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/table.pyR,PscC s�t|j�dkrdS|jj�dj�}g}xa|jj�D]P\}}|d|jkrmqHn|j|�}t||�}|j|�qHWx$|jj	�D]}|j
|�q�WdS(Nii(tlenRVRuR&RxRXR,tminR�t
itervaluesR$(RR)R*R�RkR`R%((sC/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/table.pyt_auto_set_font_sizeTscC sLxE|jj�D]4}|j|j�|�|j|j�|�qWdS(s: Scale column widths by xscale and row heights by yscale. N(RVR�R�R(t
set_heightR{(RtxscaletyscaleRw((sC/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/table.pytscaleescC s+x$|jj�D]}|j|�qWdS(sW
        Set the fontsize of the cell text

        ACCEPTS: a float in points
        N(RVR�R$(RR%R`((sC/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/table.pyR$kscC sYxR|jj�D]A}|j�|j�}}|j||�|j||�qWdS(s+Move all the artists by ox,oy (axes coords)N(RVR�tget_xtget_yR}R~(RtoxtoyRwRR((sC/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/table.pyt_offsetusc C s�x!|jD]}|j||�q
W|jr=|j|�n|j�|j|�}|j\}}}}|jdk	r�|j\}}	}
}|j	|
|||�||}|	|}
|j�nt
t|j��\}}}}}}}}}}}}}}}}}}d|d|}d|d|}
|j
|||fkr_|j|}n|j
|||||fkr�d|||j}n|j
||||fkr�d|||j}
n|j
|||fkr�|j|}
n|j
|||fkrd|d|}n|j
|||fkrJd|d|}
n|j
|||fkrp||}n|j
|||fkr�d|}n|j
|||fkr�d|}
n|j
|||fkr�||}
n|j||
�dS(Ng�?iig�?(RXR�RYR�R�RoR3RSRR�trangeR�RKRtAXESPADR�( RR)R^R8R9R:R
R;trltrbtrwtrhR�R�tBESTtURtULtLLtLRtCLtCRtLCtUCtCtTRtTLtBLtBRtRtLtTtB((sC/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/table.pyRh}sJ	



K

cC s|jS(s#return a dict of cells in the table(RV(R((sC/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/table.pyt	get_celld�sN(RCRDRERKRbR�RRRaRdRR.RoRsRvtget_child_artistsR2R�R�R�RFR,R�R�R$R�RhR�(((sC/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/table.pyRG�sP

							%					
		8RR1R0RJc
C s*|d
kr?t|�}
t|d�}dg|
g|}nt|�}
t|d�}x|D]}qbW|d
k	r�x"|D]}qWnd|g|
}|d
kr�d|g|}nd}|d
kr�|d
k	rdg|}|d}qn|d
krd|
}n|d
k	r nd}|d
krW|	d
k	rvdg|
}d}qvn|	d
krvd|}	d}n|d
k	r�n|d
kr�d|g|
}nt|||�}|j�}xqt|
�D]c}xZt|�D]L}|j|||d||d|d|||d	|||d
|�q�Wq�W|d
k	r�xQt|�D]@}|jd|d||d|d||d	|	|d
|
�qPWn|d
k	rxTt|
�D]F}|j||dd|p�dd|d||d	||d
|�q�W|dkr|jd�qn|j|�|S(sd
    TABLE(cellText=None, cellColours=None,
          cellLoc='right', colWidths=None,
          rowLabels=None, rowColours=None, rowLoc='left',
          colLabels=None, colColours=None, colLoc='center',
          loc='bottom', bbox=None)

    Factory function to generate a Table instance.

    Thanks to John Gill for providing the class and table.
    iRR
g�?iRR
RRRi����gV瞯�<N(RR�RGRdtxrangeRaR�t	add_table(R[tcellTexttcellColourstcellLoct	colWidthst	rowLabelst
rowColourstrowLoct	colLabelst
colColourstcolLocRR8R�R�R]t
rowLabelWidthtoffsetReR
R^((sC/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/table.pyRe�sx





	
(REt
__future__RRLtartistRRtpatchesRtcbookRt
matplotlibRRRt
transformsRRRGRRetinterpdR@tkwdoc(((sC/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/table.pyt<module>s$n�*		a