403Webshell
Server IP : 35.80.110.71  /  Your IP : 216.73.216.221
Web Server : Apache/2.4.58 (Ubuntu)
System : Linux ip-172-31-21-44 6.17.0-1019-aws #19~24.04.1-Ubuntu SMP Tue Jun 23 18:53:06 UTC 2026 x86_64
User : ubuntu ( 1000)
PHP Version : 8.3.31
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : OFF  |  Sudo : ON  |  Pkexec : OFF
Directory :  /usr/lib/python3/dist-packages/matplotlib/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /usr/lib/python3/dist-packages/matplotlib/__pycache__/gridspec.cpython-312.pyc
�

G8�cen����dZddlZddlZddlmZddlZddlZddlm	Z	m
Z
mZddlm
Z
eje�ZGd�d�ZGd�d	e�ZGd
�de�ZGd�d
�Zy)a�
:mod:`~matplotlib.gridspec` contains classes that help to layout multiple
`~.axes.Axes` in a grid-like pattern within a figure.

The `GridSpec` specifies the overall grid structure. Individual cells within
the grid are referenced by `SubplotSpec`\s.

Often, users need not access this module directly, and can use higher-level
methods like `~.pyplot.subplots`, `~.pyplot.subplot_mosaic` and
`~.Figure.subfigures`. See the tutorial
:doc:`/tutorials/intermediate/arranging_axes` for a guide.
�N)�Integral)�_api�_pylab_helpers�
_tight_layout)�Bboxc���eZdZdZdd�Zd�Zed�d��Zed�d	��Zd
�Z	dd�Z
dd�Zd
�Zd�Z
d�Zd�Zej"dd�dd��Zed��Zd�Zddddd�d�Zy)�GridSpecBasezm
    A base class of GridSpec that specifies the geometry of the grid
    that a subplot will be placed.
    Nc���t|t�r|dkrtd|����t|t�r|dkrtd|����||c|_|_|j|�|j
|�y)a�
        Parameters
        ----------
        nrows, ncols : int
            The number of rows and columns of the grid.
        width_ratios : array-like of length *ncols*, optional
            Defines the relative widths of the columns. Each column gets a
            relative width of ``width_ratios[i] / sum(width_ratios)``.
            If not given, all columns will have the same width.
        height_ratios : array-like of length *nrows*, optional
            Defines the relative heights of the rows. Each row gets a
            relative height of ``height_ratios[i] / sum(height_ratios)``.
            If not given, all rows will have the same height.
        rz/Number of rows must be a positive integer, not z2Number of columns must be a positive integer, not N)�
isinstancer�
ValueError�_nrows�_ncols�set_height_ratios�set_width_ratios)�self�nrows�ncols�
height_ratios�width_ratioss     �5/usr/lib/python3/dist-packages/matplotlib/gridspec.py�__init__zGridSpecBase.__init__!s����%��*�e�q�j��A�%��K�M�
M��%��*�e�q�j��D�U�I�N�P�
P�#(�%� ���T�[����}�-����l�+�c�J�tt|j��dk7rd|j��nd}tt|j��dk7rd|j��nd}dj	|j
j|j|j||z��S)N�z, height_ratios=�z, width_ratios=z&{clsname}({nrows}, {ncols}{optionals}))�clsnamerr�	optionals)	�len�set�_row_height_ratios�_col_width_ratios�format�	__class__�__name__r
r)r�
height_arg�	width_args   r�__repr__zGridSpecBase.__repr__:s����S��!8�!8�9�:�a�?�/3�.E�.E�G�EG�	��C�� 6� 6�7�8�A�=�-1�,B�,B�D�CE�	�7�>�>��N�N�+�+��+�+��+�+� �9�,�	?��	rc��|jS�N)r
�rs r�<lambda>zGridSpecBase.<lambda>F�
��$�+�+�rzThe number of rows in the grid.)�docc��|jSr))rr*s rr+zGridSpecBase.<lambda>Hr,rz"The number of columns in the grid.c�2�|j|jfS)zW
        Return a tuple containing the number of rows and columns in the grid.
        )r
rr*s r�get_geometryzGridSpecBase.get_geometryKs���{�{�D�K�K�'�'rc��yr)�)r�figures  r�get_subplot_paramszGridSpecBase.get_subplot_paramsQs��rc�2�|\}}||||z�|||z�f}|S)a[
        Create and return a `.SubplotSpec` instance.

        Parameters
        ----------
        loc : (int, int)
            The position of the subplot in the grid as
            ``(row_index, column_index)``.
        rowspan, colspan : int, default: 1
            The number of rows and columns the subplot should span in the grid.
        r2)r�loc�rowspan�colspan�loc1�loc2�subplotspecs       r�new_subplotspeczGridSpecBase.new_subplotspecUs4���
��d��4��W��,�d�4��<�.?�?�@���rc��|�dg|jz}||_yt|�|jk7rtd��||_y)z�
        Set the relative widths of the columns.

        *width_ratios* must be of length *ncols*. Each column gets a relative
        width of ``width_ratios[i] / sum(width_ratios)``.
        NrzTExpected the given number of width ratios to match the number of columns of the grid)rrrr!)rrs  rrzGridSpecBase.set_width_ratiosesT�����3����,�L�".�����
�$�+�+�
-��G�H�
H�!-��rc��|jS)zo
        Return the width ratios.

        This is *None* if no width ratios have been set explicitly.
        )r!r*s r�get_width_ratioszGridSpecBase.get_width_ratiosss���%�%�%rc��|�dg|jz}||_yt|�|jk7rtd��||_y)z�
        Set the relative heights of the rows.

        *height_ratios* must be of length *nrows*. Each row gets a relative
        height of ``height_ratios[i] / sum(height_ratios)``.
        NrzRExpected the given number of height ratios to match the number of rows of the grid)r
rrr )rrs  rrzGridSpecBase.set_height_ratios{sT��� ��C�$�+�+�-�M�#0�����
�4�;�;�
.��D�E�
E�"/��rc��|jS)zq
        Return the height ratios.

        This is *None* if no height ratios have been set explicitly.
        )r r*s r�get_height_ratioszGridSpecBase.get_height_ratios�s���&�&�&rz3.7�rawFc���|j�\}}|r
d}d}d}d}d}	d}
nY|j|�}|j}|j}|j}|j
}|j}	|j}
||z
}||z
}
|
||
|dz
zzz}|
|z}||zt|j�z}|jD�cgc]}||z��	}}dg|g|dz
zz}tjtj||g�j�}|||	|dz
zzz}|	|z}||zt|j�z}|jD�cgc]}||z��	}}dg|g|dz
zz}tjtj||g�j�}||z
jd�j \}}||zjd�j \}}||||fScc}wcc}w)a
        Return the positions of the grid cells in figure coordinates.

        Parameters
        ----------
        fig : `~matplotlib.figure.Figure`
            The figure the grid should be applied to. The subplot parameters
            (margins and spacing between subplots) are taken from *fig*.
        raw : bool, default: False
            If *True*, the subplot parameters of the figure are not taken
            into account. The grid spans the range [0, 1] in both directions
            without margins and there is no space between grid cells. This is
            used for constrained_layout.

        Returns
        -------
        bottoms, tops, lefts, rights : array
            The bottom, top, left, right positions of the grid cells in
            figure coordinates.
        gg�?rr)����)r0r4�left�right�bottom�top�wspace�hspace�sumr �np�cumsum�column_stack�flatr!�reshape�T)r�figrCrrrGrHrIrJrKrL�subplot_params�	tot_width�
tot_height�cell_h�sep_h�norm�r�cell_heights�sep_heights�cell_hs�cell_w�sep_w�cell_widths�
sep_widths�cell_ws�fig_tops�fig_bottoms�	fig_lefts�
fig_rightss                              r�get_grid_positionszGridSpecBase.get_grid_positions�s��,�(�(�*���u���D��E��F��C��F��F�!�4�4�S�9�N�!�&�&�D�"�(�(�E�#�*�*�F� �$�$�C�#�*�*�F�#�*�*�F��D�L�	��6�\�
��u�v�u�Q�w�'7�7�8��������~��D�$;�$;� <�<��*.�*A�*A�B�Q��D��B��B��c�e�W��a��0�1���)�)�B�O�O�[�,�,G�H�M�M�N���e�f�e�A�g�&6�6�7��������~��D�$:�$:� ;�;��)-�)?�)?�@�A�q�4�x�@��@��S�U�G�u�Q�w�/�0�
��)�)�B�O�O�Z��,E�F�K�K�L��!$�w�� 7� 7�� @� B� B���+�!%��� 8� 8�� A� C� C��	�:��H�i��;�;��C��As�G$�
G)c�$�|j�D]p}t|d�s�|j�j�}t|d�r|j	�j�}|j�||fk(s�n|cSt
|||��S)zo
        Check if the figure already has a gridspec with these dimensions,
        or create a new one
        �get_subplotspec�get_topmost_subplotspec�r3)�get_axes�hasattrrj�get_gridspecrkr0�GridSpec)r3rr�ax�gss     r�_check_gridspec_existsz#GridSpecBase._check_gridspec_exists�s����/�/�#�	�B��r�,�-��'�'�)�6�6�8���2�8�9��3�3�5�B�B�D�B��?�?�$����6��I�	���u�V�4�4rc�*�|j�\}}d�}t|t�r4	|\}}t	j
|||d�|||d�g||f�\}}	n||||zd�\}}	t
|||	�S#t$r}td�|�d}~wwxYw)z,Create and return a `.SubplotSpec` instance.c��|}t|t�r,|j|�\}}}||kDr||dz
fStd��|dkr||z}d|cxkr|kr||fS|�td|�d|�d|����td|�d|����)Nrz=GridSpec slice would result in no space allocated for subplotrzindex z is out of bounds for axis z with size z) is out of bounds for GridSpec with size )r�slice�indices�
IndexError)�key�size�axis�orig_key�start�stop�_s       r�
_normalizez,GridSpecBase.__getitem__.<locals>._normalize�s����H��#�u�%�!$���T�!2���t�Q��%�<� �$��(�?�*� �"9�:�:���7���*�C���?�d�?���8�O�#��%�$�v�h�Z�8-�-1�F�+�d�V�&E�F�F�%�v�h�Z�8;�;?�&�&B�C�CrzUnrecognized subplot specNrr)r0r�tuplerrN�ravel_multi_index�SubplotSpec)
rryrrr��k1�k2�err�num1�num2s
          r�__getitem__zGridSpecBase.__getitem__�s����(�(�*���u�	C�(�c�5�!�
G����B��-�-��B��q�)�:�b�%��+C�D���� �J�D�$�$�C�����=�J�D�$��4��t�,�,���
G� �!<�=�3�F��
G�s�A8�8	B�B
�
BT)�sharex�sharey�squeeze�
subplot_kwc��|j}|�td��t|t�r|rdnd}t|t�r|rdnd}t|t�rtjd�tjgd�||��|�i}|j�}tj|j|jft��}t|j�D]]}t|j�D]C}d|d	||d
f|d
|fd�}	|	||d<|	||d
<|j|||ffi|��|||f<�E�_|dvr#|j D]}
|
j#d���|dvr#|j D]}
|
j%d���|r/|j&dk(r|j)�S|j+�S|S)z�
        Add all subplots specified by this `GridSpec` to its parent figure.

        See `.Figure.subplots` for detailed documentation.
        NzIGridSpec.subplots() only works for GridSpecs created with a parent figure�all�nonez]sharex argument to subplots() was an integer.  Did you intend to use subplot() (without 's')?)r��row�colr�)r�r�)�dtype)rrr)r�r�r�r�r�r�)r�r�T)�check_patch)r�r�r)r3rr�boolrr�
warn_external�
check_in_list�copyrN�emptyr
r�object�range�add_subplotrQ�_label_outer_xaxis�_label_outer_yaxisrz�itemr�)rr�r�r�r�r3�axarrr�r��shared_withrqs           r�subplotszGridSpecBase.subplots	s��������>��<�=�
=��f�d�#�$�U�&�F��f�d�#�$�U�&�F��f�h�'����9�
:�	
���8�"(��	9����J��_�_�&�
����$�+�+�t�{�{�3�6�B������%�	2�C��T�[�[�)�
2��'+�E�$�K�&+�C��F�m�E�!�S�&�M�K��'2�6�':�
�8�$�'2�6�':�
�8�$�"4�&�"4�"4���c��N�#2�&0�#2��c�3�h��
2�	2��^�#��j�j�
8���%�%�$�%�7�
8��^�#��j�j�
8���%�%�$�%�7�
8��$)�:�:��?�5�:�:�<�G��
�
��G��Lr)NNr))rr)F)r$�
__module__�__qualname__�__doc__rr'�propertyrrr0r4r<rr?rrBr�delete_parameterrh�staticmethodrsr�r�r2rrr	r	s����
,�2
�
�-�:�
<�E��-�=�
?�E�(�
�� .�&�0�'��T���5�%�(�;<�)�;<�z�5��5�(#-�J"'�u�d� �<rr	c�T��eZdZdZ				d�fd�	Zgd�Zd�Zd	d�Zd�Z		d
d�Z	�xZ
S)rpa
    A grid layout to place subplots within a figure.

    The location of the grid cells is determined in a similar way to
    `~.figure.SubplotParams` using *left*, *right*, *top*, *bottom*, *wspace*
    and *hspace*.

    Indexing a GridSpec instance returns a `.SubplotSpec`.
    c���||_||_||_||_||_|	|_||_t�|�!|||
|��y)a�
        Parameters
        ----------
        nrows, ncols : int
            The number of rows and columns of the grid.

        figure : `.Figure`, optional
            Only used for constrained layout to create a proper layoutgrid.

        left, right, top, bottom : float, optional
            Extent of the subplots as a fraction of figure width or height.
            Left cannot be larger than right, and bottom cannot be larger than
            top. If not given, the values will be inferred from a figure or
            rcParams at draw time. See also `GridSpec.get_subplot_params`.

        wspace : float, optional
            The amount of width reserved for space between subplots,
            expressed as a fraction of the average axis width.
            If not given, the values will be inferred from a figure or
            rcParams when necessary. See also `GridSpec.get_subplot_params`.

        hspace : float, optional
            The amount of height reserved for space between subplots,
            expressed as a fraction of the average axis height.
            If not given, the values will be inferred from a figure or
            rcParams when necessary. See also `GridSpec.get_subplot_params`.

        width_ratios : array-like of length *ncols*, optional
            Defines the relative widths of the columns. Each column gets a
            relative width of ``width_ratios[i] / sum(width_ratios)``.
            If not given, all columns will have the same width.

        height_ratios : array-like of length *nrows*, optional
            Defines the relative heights of the rows. Each row gets a
            relative height of ``height_ratios[i] / sum(height_ratios)``.
            If not given, all rows will have the same height.

        �rrN)	rGrIrHrJrKrLr3�superr)
rrrr3rGrIrHrJrKrLrrr#s
            �rrzGridSpec.__init__RsS���T��	������
�������������
�����&2�'4�	�	6r)rGrIrHrJrKrLc�H�|j�D].\}}||jvrt|||��"t|�d���tj
jj�D]�}|jjjD]�}t|tjj�s�(|j�j�}|j!�|k(s�Z|j#|j�j%|j������y)a
        Update the subplot parameters of the grid.

        Parameters that are not explicitly given are not changed. Setting a
        parameter to *None* resets it to :rc:`figure.subplot.*`.

        Parameters
        ----------
        left, right, top, bottom : float or None, optional
            Extent of the subplots as a fraction of figure width or height.
        wspace, hspace : float, optional
            Spacing between the subplots as a fraction of the average subplot
            width / height.
        z is an unknown keywordN)�items�_AllowedKeys�setattr�AttributeErrorr�Gcf�figs�values�canvasr3�axesr�mpl�SubplotBaserjrkro�
_set_position�get_position)r�kwargs�k�v�
figmanagerrq�sss       r�updatezGridSpec.update�s����L�L�N�	C�D�A�q��D�%�%�%���a��#�$��s�*@�%A�B�B�		C�
)�,�,�1�1�8�8�:�	J�J� �'�'�.�.�3�3�
J���b�#�(�(�"6�"6�7��+�+�-�E�E�G�B����(�D�0��(�(��.�.�0�=�=�b�i�i�H�J�	
J�	Jrc�b�|�N|jD�cic]}|tjd|z��}}tjjdi|��}ntj
|j�}|jdi|jD�cic]}|t||���c}��|Scc}wcc}w)z�
        Return the `.SubplotParams` for the GridSpec.

        In order of precedence the values are taken from

        - non-*None* attributes of the GridSpec
        - the provided *figure*
        - :rc:`figure.subplot.*`
        zfigure.subplot.r2)	r�r��rcParamsr3�
SubplotParamsr��subplotparsr��getattr)rr3r��kwr�s     rr4zGridSpec.get_subplot_params�s����>��,�,�.���S�\�\�"3�A�"5�6�6�.�B�.��*�*�2�2�8�R�8�K��)�)�F�$6�$6�7�K�����N�4�;L�;L�M�a�a���q�!1�1�M�N����.��Ns�B'�B,c�Z�|jD�cgc]}t||�s�|��c}Scc}w)z�
        Return a list of the names of the subplot parameters explicitly set
        in the GridSpec.

        This is a subset of the attributes of `.SubplotParams`.
        )r�r�)rr�s  r�locally_modified_subplot_paramsz(GridSpec.locally_modified_subplot_params�s'�� �,�,�A�a���a�0@��A�A��As�(�(c
���|�|j�}tj||jtj|j|��|||||��}|r|j
di|��yy)a�
        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, optional
            Padding (height/width) between edges of adjacent subplots.
            Defaults to *pad*.
        rect : tuple (left, bottom, right, top), default: None
            (left, bottom, right, top) rectangle in normalized figure
            coordinates that the whole subplots area (including labels) will
            fit into. Default (None) is the whole figure.
        N)�	grid_spec)�pad�h_pad�w_pad�rectr2)�
_get_rendererr�get_tight_layout_figurer��get_subplotspec_listr�)rr3�rendererr�r�r�r�r�s        r�tight_layoutzGridSpec.tight_layout�sl��$���+�+�-�H��6�6��F�K�K��.�.�v�{�{�d�K��#�U�%�d�D����D�K�K�!�&�!�r)	NNNNNNNNNr))NgH�z�G�?NNN)r$r�r�r�rr�r�r4r�r��
__classcell__�r#s@rrprpHsB����-1�9=�%)�26�46�lJ�L�J�8�*B�-1�<@�"rrpc�6��eZdZdZ		d�fd�	Zdd�Zd�Z�xZS)�GridSpecFromSubplotSpeczx
    GridSpec whose subplot layout parameters are inherited from the
    location specified by a given SubplotSpec.
    c���||_||_||_|jj�j|_t
�|�||||��y)ak
        Parameters
        ----------
        nrows, ncols : int
            Number of rows and number of columns of the grid.
        subplot_spec : SubplotSpec
            Spec from which the layout parameters are inherited.
        wspace, hspace : float, optional
            See `GridSpec` for more details. If not specified default values
            (from the figure or rcParams) are used.
        height_ratios : array-like of length *nrows*, optional
            See `GridSpecBase` for details.
        width_ratios : array-like of length *ncols*, optional
            See `GridSpecBase` for details.
        r�N)�_wspace�_hspace�
_subplot_specror3r�r)	rrr�subplot_specrKrLrrr#s	        �rrz GridSpecFromSubplotSpec.__init__�sS���&������)����(�(�5�5�7�>�>���
�����&2�'4�	�	6rc��|j�|jn*|�|jjntjd}|j
�|j
n*|�|jjntjd}|jj|�}|j\}}}}tjj||||||��S)z1Return a dictionary of subplot layout parameters.zfigure.subplot.hspacezfigure.subplot.wspace)rGrHrIrJrKrL)r�r�rLr�r�r�rKr�r��extentsr3r�)	rr3rLrK�figboxrGrIrHrJs	         rr4z*GridSpecFromSubplotSpec.get_subplot_paramss���"&�,�,�":�$�,�,�4:�4F�v�)�)�0�0��|�|�$;�<�	�#'�,�,�":�$�,�,�4:�4F�v�)�)�0�0��|�|�$;�<�	��#�#�0�0��8��#)�>�>� ��f�e�S��z�z�'�'�T��/5�3�/5�f�(�F�	Frc�6�|jj�S)zY
        Return the topmost `.SubplotSpec` instance associated with the subplot.
        )r�rkr*s rrkz/GridSpecFromSubplotSpec.get_topmost_subplotspecs���!�!�9�9�;�;r)NNNNr))r$r�r�r�rr4rkr�r�s@rr�r��s ����&*�26�6�6F� <rr�c���eZdZdZdd�Zd�Zed��Zed��Z	e	jd��Z	d�Zd	�Zed
��Z
ed��Zd�Zd
�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zy)r�a]
    The location of a subplot in a `GridSpec`.

    .. note::

        Likely, you will never instantiate a `SubplotSpec` yourself. Instead,
        you will typically obtain one from a `GridSpec` using item-access.

    Parameters
    ----------
    gridspec : `~matplotlib.gridspec.GridSpec`
        The GridSpec, which the subplot is referencing.
    num1, num2 : int
        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 **inclusive**.

        The index starts from 0.
    Nc�.�||_||_||_yr))�	_gridspecr�r�)r�gridspecr�r�s    rrzSubplotSpec.__init__+s��!�����	���	rc
���|j��d|jj�d|jj�d|jj�d|jj�d�
S)N�[�:z, �])ror7r}r~r8r*s rr'zSubplotSpec.__repr__0sc���$�$�&�'�q��<�<�%�%�&�a����(9�(9�':�"��<�<�%�%�&�a����(9�(9�':�!�=�	>rc��t|�dk(rS|\}t|t�r|St|t�st	d|����	ttt|��\}}}n-t|�dk(r|\}}}ntdt|��d���tj|||�}|�t|||��}t|t�r4t|�dk(r&td	�|D��st	d
|����|\}}n5t|t�r
|dks|||zkDrt	d||z�d|����|x}}||dz
|S#t$rt	d|���d�wxYw)
z�
        Construct a `.SubplotSpec` from a parent `.Figure` and either

        - a `.SubplotSpec` -- returned as is;
        - one or three numbers -- a MATLAB-style subplot specifier.
        rz>Single argument to subplot must be a three-digit integer, not N�z0subplot() takes 1 or 3 positional arguments but z were givenrlrFc3�<K�|]}t|t����y�wr))rr)�.0�ns  r�	<genexpr>z1SubplotSpec._from_subplot_args.<locals>.<genexpr>Us����<�1�z�!�X�.�<�s�z3Subplot specifier tuple must contain integers, not znum must be 1 <= num <= z, not )
rrr�rr�map�int�str�	TypeErrorrprsr�r�)	r3�args�arg�rows�cols�numrr�i�js	         r�_from_subplot_argszSubplotSpec._from_subplot_args5s����t�9��>��D�C��#�{�+��
���X�.� �$�$'�7�,�-�-�
7�"%�c�3�s�8�"4���d�C�
��Y�!�^�"�O�D�$���N�"�4�y�k��6�7�
7��
,�
,�V�T�4�
@��
�:��$��V�4�B��c�5�!�c�#�h�!�m��<��<�<� �I�#��O����D�A�q��c�8�,��a��3��d��?� �.�t�D�y�k���w�G�I�I��K�A���!�A�#�a�y���1�
7� �$�$'�7�,�-�26�7�
7�s�D7�7Ec�J�|j�|jS|jSr))�_num2r�r*s rr�zSubplotSpec.num2ds�� �J�J�.�t�y�y�>�D�J�J�>rc��||_yr))r�)r�values  rr�zSubplotSpec.num2hs	����
rc��|jSr))r�r*s rrozSubplotSpec.get_gridspecls���~�~�rc�x�|j�j�\}}|||j|jfS)a
        Return the subplot geometry as tuple ``(n_rows, n_cols, start, stop)``.

        The indices *start* and *stop* define the range of the subplot within
        the `GridSpec`. *stop* is inclusive (i.e. for a single cell
        ``start == stop``).
        )ror0r�r�)rr�r�s   rr0zSubplotSpec.get_geometryos6���&�&�(�5�5�7�
��d��T�4�9�9�d�i�i�/�/rc��|j�j}t|j|z|j|zdz�S)z6The rows spanned by this subplot, as a `range` object.r)rorr�r�r�)rrs  rr7zSubplotSpec.rowspanzs<���!�!�#�)�)���T�Y�Y�%�'����e�);�a�)?�@�@rc��|j�j}t|j|z|j|zg�\}}t||dz�S)z9The columns spanned by this subplot, as a `range` object.r)ror�sortedr�r�r�)rr�c1�c2s    rr8zSubplotSpec.colspan�sP���!�!�#�)�)������U�*�D�I�I��,=�>�?���B��R��a�� � rc�4�|jjdk(S�Nr)r7r}r*s r�is_first_rowzSubplotSpec.is_first_row�����|�|�!�!�Q�&�&rc�d�|jj|j�jk(Sr))r7r~rorr*s r�is_last_rowzSubplotSpec.is_last_row��&���|�|� � �D�$5�$5�$7�$=�$=�=�=rc�4�|jjdk(Sr)r8r}r*s r�is_first_colzSubplotSpec.is_first_col�r	rc�d�|jj|j�jk(Sr))r8r~rorr*s r�is_last_colzSubplotSpec.is_last_col�rrc��|j�}|j�\}}tj|j|j
g||f�\}}|j
|�\}}}	}
||j�}||j�}|	|j�}
|
|j�}tj|
|||�S)zJ
        Update the subplot position from ``figure.subplotpars``.
        )ror0rN�
unravel_indexr�r�rh�min�maxr�from_extents)rr3r�rrr�r�rerdrfrg�
fig_bottom�fig_top�fig_left�	fig_rights               rr�zSubplotSpec.get_position�s����$�$�&���,�,�.���u��%�%�t�y�y�$�)�)�&<�u�e�n�M�
��d��'�'��/�	5��X�y�*�!��&�*�*�,�
��4�.�$�$�&���T�?�&�&�(���t�$�(�(�*�	�� � ��:�y�'�J�Jrc�^�|j�}t|d�r|j�S|S)zX
        Return the topmost `SubplotSpec` instance associated with the subplot.
        rk)rornrk)rr�s  rrkz#SubplotSpec.get_topmost_subplotspec�s1���$�$�&���8�6�7��3�3�5�5��Krc	���|j|j|jft|dt	��t|dt	��t|dt	��fk(S)z}
        Two SubplotSpecs are considered equal if they refer to the same
        position(s) in the same `GridSpec`.
        r�r�r�)r�r�r�r�r�)r�others  r�__eq__zSubplotSpec.__eq__�sS��������D�I�I�6��E�;���9��E�6�6�8�4��E�6�6�8�4�6�6�	7rc�Z�t|j|j|jf�Sr))�hashr�r�r�r*s r�__hash__zSubplotSpec.__hash__�s ���T�^�^�T�Y�Y��	�	�:�;�;rc��t|||fi|��S)a�
        Create a GridSpec within this subplot.

        The created `.GridSpecFromSubplotSpec` will have this `SubplotSpec` as
        a parent.

        Parameters
        ----------
        nrows : int
            Number of rows in grid.

        ncols : int
            Number of columns in grid.

        Returns
        -------
        `.GridSpecFromSubplotSpec`

        Other Parameters
        ----------------
        **kwargs
            All other parameters are passed to `.GridSpecFromSubplotSpec`.

        See Also
        --------
        matplotlib.pyplot.subplots

        Examples
        --------
        Adding three subplots in the space occupied by a single subplot::

            fig = plt.figure()
            gs0 = fig.add_gridspec(3, 1)
            ax1 = fig.add_subplot(gs0[0])
            ax2 = fig.add_subplot(gs0[1])
            gssub = gs0[2].subgridspec(1, 3)
            for i in range(3):
                fig.add_subplot(gssub[0, i])
        )r�)rrrr�s    r�subgridspeczSubplotSpec.subgridspec�s��P'�u�e�T�D�V�D�Drr))r$r�r�r�rr'r�r�r�r��setterror0r7r8rrrrr�rkrr r"r2rrr�r�s����&�
>�
�)��)�\�?��?�
�[�[�����	0��A��A�
�!��!�'�>�'�>�K� �	7�<�(Err�)r�r��logging�numbersr�numpyrN�
matplotlibr�rrr�matplotlib.transformsr�	getLoggerr$�_logr	rpr�r�r2rr�<module>r+sm��������:�:�&��w����"��j�j�Z	U"�|�U"�p4<�l�4<�nNE�NEr

Youez - 2016 - github.com/yon3zu
LinuXploit