
    P/Ph                         d dl mZ d dlmZ  G d de          Z G d de          Z G d de          Z G d	 d
e          ZdS )    )cbook)Artistc                   x    e Zd ZdZd Zd ZddZd Zd Ze	j
        Z
e	j        Ze	j        Ze	j        Ze	j        ZdS )		Containerz
    Base class for containers.

    Containers are classes that collect semantically related Artists such as
    the bars of a bar plot.
    c                 R    dt          |           j         dt          |            dS )N<z object of z	 artists>)type__name__lenselfs    T/var/www/html/test/jupyter/venv/lib/python3.11/site-packages/matplotlib/container.py__repr__zContainer.__repr__   s*    G4::&GG3t99GGGG    c                 D    t                               | |d                   S )Nr   )tuple__new__)clsargskwargss      r   r   zContainer.__new__   s    }}S$q'***r   Nc                 z    t          j        dg          | _        d | _        |t	          |          nd | _        d S )Npchanged)signals)r   CallbackRegistry
_callbacks_remove_methodstr_label)r   kllabels      r   __init__zContainer.__init__   s;    0*FFF"$)$5c%jjj4r   c                     t          j        | d           D ]}||                                 | j        r|                     |            d S d S )Nc                 ,    t          | t                    S N)
isinstancer   )xs    r   <lambda>z"Container.remove.<locals>.<lambda>   s    
1f(=(= r   )scalarp)r   flattenremover   )r   cs     r   r*   zContainer.remove   sm    ==? ? ? 	 	A}


 	&%%%%%	& 	&r   c                 >    d t          j        |           D             S )Nc                     g | ]}||S r$    ).0childs     r   
<listcomp>z*Container.get_children.<locals>.<listcomp>!   s    LLL%%:K:K:K:Kr   )r   r)   r   s    r   get_childrenzContainer.get_children    s     LL5=#6#6LLLLr   r$   )r
   
__module____qualname____doc__r   r   r!   r*   r2   r   	get_label	set_labeladd_callbackremove_callbackr   r.   r   r   r   r      s         H H H+ + +@ @ @ @
& & &M M M  I I&L,OHHHr   r   c                   ,     e Zd ZdZdddd fdZ xZS )BarContainera4  
    Container for the artists of bar plots (e.g. created by `.Axes.bar`).

    The container can be treated as a tuple of the *patches* themselves.
    Additionally, you can access these and further parameters by the
    attributes.

    Attributes
    ----------
    patches : list of :class:`~matplotlib.patches.Rectangle`
        The artists of the bars.

    errorbar : None or :class:`~matplotlib.container.ErrorbarContainer`
        A container for the error bar artists if error bars are present.
        *None* otherwise.

    datavalues : None or array-like
        The underlying data values corresponding to the bars.

    orientation : {'vertical', 'horizontal'}, default: None
        If 'vertical', the bars are assumed to be vertical.
        If 'horizontal', the bars are assumed to be horizontal.

    N)
datavaluesorientationc                t    || _         || _        || _        || _         t	                      j        |fi | d S r$   )patcheserrorbarr<   r=   superr!   )r   r?   r@   r<   r=   r   	__class__s         r   r!   zBarContainer.__init__D   sE     $&++F+++++r   r$   r
   r3   r4   r5   r!   __classcell__rB   s   @r   r;   r;   *   sV         2,T!, , , , , , , , , , ,r   r;   c                   $     e Zd ZdZd fd	Z xZS )ErrorbarContainera  
    Container for the artists of error bars (e.g. created by `.Axes.errorbar`).

    The container can be treated as the *lines* tuple itself.
    Additionally, you can access these and further parameters by the
    attributes.

    Attributes
    ----------
    lines : tuple
        Tuple of ``(data_line, caplines, barlinecols)``.

        - data_line : A `~matplotlib.lines.Line2D` instance of x, y plot markers
          and/or line.
        - caplines : A tuple of `~matplotlib.lines.Line2D` instances of the error
          bar caps.
        - barlinecols : A tuple of `~matplotlib.collections.LineCollection` with the
          horizontal and vertical error ranges.

    has_xerr, has_yerr : bool
        ``True`` if the errorbar has x/y errors.

    Fc                 f    || _         || _        || _         t                      j        |fi | d S r$   )lineshas_xerrhas_yerrrA   r!   )r   rI   rJ   rK   r   rB   s        r   r!   zErrorbarContainer.__init__f   s=    
  ))&)))))r   )FFrC   rE   s   @r   rG   rG   M   sG         0* * * * * * * * * *r   rG   c                   "     e Zd ZdZ fdZ xZS )StemContainera  
    Container for the artists created in a :meth:`.Axes.stem` plot.

    The container can be treated like a namedtuple ``(markerline, stemlines,
    baseline)``.

    Attributes
    ----------
    markerline : `~matplotlib.lines.Line2D`
        The artist of the markers at the stem heads.

    stemlines : `~matplotlib.collections.LineCollection`
        The artists of the vertical lines for all stems.

    baseline : `~matplotlib.lines.Line2D`
        The artist of the horizontal baseline.
    c                 r    |\  }}}|| _         || _        || _         t                      j        |fi | dS )aZ  
        Parameters
        ----------
        markerline_stemlines_baseline : tuple
            Tuple of ``(markerline, stemlines, baseline)``.
            ``markerline`` contains the `.Line2D` of the markers,
            ``stemlines`` is a `.LineCollection` of the main lines,
            ``baseline`` is the `.Line2D` of the baseline.
        N)
markerline	stemlinesbaselinerA   r!   )r   markerline_stemlines_baseliner   rO   rP   rQ   rB   s         r   r!   zStemContainer.__init__   sM     +H'
Ix$" 6AA&AAAAAr   rC   rE   s   @r   rM   rM   m   sK         "B B B B B B B B Br   rM   N)	
matplotlibr   matplotlib.artistr   r   r   r;   rG   rM   r.   r   r   <module>rU      s          $ $ $ $ $ $" " " " " " " "J ,  ,  ,  ,  ,9  ,  ,  ,F* * * * *	 * * *@ B  B  B  B  BI  B  B  B  B  Br   