
    ^j                         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
      Z G d de      Z	y)    )cbook)Artistc                       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y)		Containerz
    Base class for containers.

    Containers are classes that collect semantically related Artists such as
    the bars of a bar plot.
    c                 L    dt        |       j                   dt        |        dS )N<z object of z	 artists>)type__name__len)selfs    M/opt/ringagent/.cad-venv/lib/python3.12/site-packages/matplotlib/container.py__repr__zContainer.__repr__   s&    4:&&'{3t9+YGG    c                 4    t         j                  | |d         S )Nr   )tuple__new__)clsargskwargss      r   r   zContainer.__new__   s    }}S$q'**r   Nc                 ~    t        j                  dg      | _        d | _        |t	        |      | _        y d | _        y )Npchanged)signals)r   CallbackRegistry
_callbacks_remove_methodstr_label)r   kllabels      r   __init__zContainer.__init__   s4    00*F"$)$5c%j4r   c                     t        j                  | d       D ]  }||j                           | j                  r| j                  |        y y )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   sL    =? 	A}
	 % r   c                 X    t        j                  |       D cg c]  }||	 c}S c c}w r#   )r   r(   )r   childs     r   get_childrenzContainer.get_children    s$    #(==#6L%%:KLLLs   ''r#   )r
   
__module____qualname____doc__r   r   r    r)   r-   r   	get_label	set_labeladd_callbackremove_callbackr    r   r   r   r      sZ    H+@
&M   I  I&&L,,OHr   r   c                   \     e Zd ZdZdddd fdZed        Zed        Ze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	        |   |fi | y r#   )patcheserrorbarr8   r9   superr    )r   r;   r<   r8   r9   r   	__class__s         r   r    zBarContainer.__init__D   s2     $&+F+r   c                    | j                   dk(  r(| j                  D cg c]  }|j                          c}S | j                   dk(  r(| j                  D cg c]  }|j                          c}S t	        d      c c}w c c}w )za
        Return the values at the lower end of the bars.

        .. versionadded:: 3.11
        vertical
horizontal/orientation must be 'vertical' or 'horizontal'.)r9   r;   get_yget_x
ValueErrorr   ps     r   bottomszBarContainer.bottomsL   sj     z)'+||4!AGGI44-'+||4!AGGI44NOO	 54s   A:A?c                 L   | j                   dk(  r9| j                  D cg c]#  }|j                         |j                         z   % c}S | j                   dk(  r9| j                  D cg c]#  }|j	                         |j                         z   % c}S t        d      c c}w c c}w )za
        Return the values at the upper end of the bars.

        .. versionadded:: 3.11
        r@   rA   rB   )r9   r;   rC   
get_heightrD   	get_widthrE   rF   s     r   topszBarContainer.topsZ   s     z)8<E1AGGI.EE-7;||D!AGGI-DDNOO	 FDs   (B&(B!c                 X   | j                   dk(  r<| j                  D cg c]&  }|j                         |j                         dz  z   ( c}S | j                   dk(  r<| j                  D cg c]&  }|j	                         |j                         dz  z   ( c}S t        d      c c}w c c}w )zV
        Return the centers of bar positions.

        .. versionadded:: 3.11
        r@      rA   rB   )r9   r;   rD   rK   rC   rJ   rE   rF   s     r   position_centerszBarContainer.position_centersh   s     z);?<<HaAGGI 11HH-<@LLIqAGGI 22IINOO	 IIs   +B")+B'r#   )
r
   r.   r/   r0   r    propertyrH   rL   rO   __classcell__r>   s   @r   r7   r7   *   sY    2,T!, P P P P P Pr   r7   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.

    c                 P    || _         || _        || _        t        |   |fi | y r#   )lineshas_xerrhas_yerrr=   r    )r   rV   rW   rX   r   r>   s        r   r    zErrorbarContainer.__init__   s*    
  )&)r   )FFr
   r.   r/   r0   r    rQ   rR   s   @r   rT   rT   w   s    0* *r   rT   c                   X    e Zd ZdZd Zed        Zed        Zed        Zd Z	d Z
d Zy	)
PieContainera  
    Container for the artists of pie charts (e.g. created by `.Axes.pie`).

    .. versionadded:: 3.11

    .. warning::
        The class name ``PieContainer`` name is provisional and may change in future
        to reflect development of its functionality.

    You can access the wedge patches and further parameters by the attributes.

    Attributes
    ----------
    wedges : list of `~matplotlib.patches.Wedge`
        The artists of the pie wedges.

    values : `numpy.ndarray`
        The data that the pie is based on.

    fracs : `numpy.ndarray`
        The fraction of the pie that each wedge represents.

    texts : list of list of `~matplotlib.text.Text`
        The artists of any labels on the pie wedges.  Each inner list has one
        text label per wedge.

    c                 <    || _         g | _        || _        || _        y r#   )wedges_texts_values
_normalize)r   r]   values	normalizes       r   r    zPieContainer.__init__   s    #r   c                 F    | j                   D cg c]  }|s|	 c}S c c}w r#   )r^   )r   t_lists     r   textszPieContainer.texts   s     &*[[;6F;;;s   c                 \    | j                   j                         }d|j                  _        |S NF)r_   copyflags	writeabler   results     r   ra   zPieContainer.values   s%    ""$!&r   c                     | j                   r(| j                  | j                  j                         z  }n| j                  }d|j                  _        |S rg   )r`   r_   sumri   rj   rk   s     r   fracszPieContainer.fracs   s>    ??\\DLL$4$4$66F\\F!&r   c                 :    | j                   j                  |       y)z?Add a list of `~matplotlib.text.Text` objects to the container.N)r^   append)r   re   s     r   	add_textszPieContainer.add_texts   s    5!r   c                     | j                   | j                  fD ],  }t        j                  |      D ]  }|j	                           . y)z)Remove all wedges and texts from the axesN)r]   r^   r   r(   r)   )r   artist_listartists      r   r)   zPieContainer.remove   s?    ;;3 	 K--4   	 r   c                 <    | j                   g| j                  |   S r#   )r]   r^   )r   keys     r   __getitem__zPieContainer.__getitem__   s     *dkk*3//r   N)r
   r.   r/   r0   r    rP   re   ra   ro   rr   r)   rx   r5   r   r   r[   r[      sW    6$ < <
  
  " 0r   r[   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                 \    |\  }}}|| _         || _        || _        t        |   |fi | y)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baseliner=   r    )r   markerline_stemlines_baseliner   r|   r}   r~   r>   s         r   r    zStemContainer.__init__   s:     +H'
Ix$" 6A&Ar   rY   rR   s   @r   rz   rz      s    "B Br   rz   N)

matplotlibr   matplotlib.artistr   r   r   r7   rT   r[   rz   r5   r   r   <module>r      sQ     $" "JJP9 JPZ*	 *@E0 E0P BI  Br   