
    G8c                     t    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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                 ^    dj                  t        |       j                  t        |             S )Nz<{} object of {} artists>)formattype__name__len)selfs    6/usr/lib/python3/dist-packages/matplotlib/container.py__repr__zContainer.__repr__   s$    +T
++SY7	9    c                 4    t         j                  | |d         S )Nr   )tuple__new__)clsargskwargss      r   r   zContainer.__new__   s    }}S$q'**r   Nc                 l    t        j                  dg      | _        d | _        | j	                  |       y )Npchanged)signals)r   CallbackRegistry
_callbacks_remove_method	set_label)r   kllabels      r   __init__zContainer.__init__   s*    00*F"u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_labelr   add_callbackremove_callbackr    r   r   r   r      sX    9+
&M   I  I&&L,,OHr   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	        |   |fi | y r"   )patcheserrorbarr6   r7   superr   )r   r9   r:   r6   r7   r   	__class__s         r   r   zBarContainer.__init__E   s2     $&+F+r   r"   r
   r-   r.   r/   r   __classcell__r<   s   @r   r5   r5   +   s    2,T!, ,r   r5   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 : :class:`~matplotlib.lines.Line2D` instance of
          x, y plot markers and/or line.
        - caplines : tuple of :class:`~matplotlib.lines.Line2D` instances of
          the error bar caps.
        - barlinecols : list of :class:`~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   rC   rD   rE   r   r<   s        r   r   zErrorbarContainer.__init__g   s*    
  )&)r   )FFr=   r?   s   @r   rA   rA   N   s    0* *r   rA   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 :  :class:`~matplotlib.lines.Line2D`
        The artist of the markers at the stem heads.

    stemlines : list of :class:`~matplotlib.lines.Line2D`
        The artists of the vertical lines for all stems.

    baseline : :class:`~matplotlib.lines.Line2D`
        The artist of the horizontal baseline.
    c                 \    |\  }}}|| _         || _        || _        t        |   |fi | y)ab  
        Parameters
        ----------
        markerline_stemlines_baseline : tuple
            Tuple of ``(markerline, stemlines, baseline)``.
            ``markerline`` contains the `.LineCollection` 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   rI   rJ   rK   r<   s         r   r   zStemContainer.__init__   s:     +H'
Ix$" 6A&Ar   r=   r?   s   @r   rG   rG   n   s    "B Br   rG   N)	
matplotlibr   matplotlib.artistr   r   r   r5   rA   rG   r3   r   r   <module>rO      s@     $# #L ,9  ,F*	 *@ BI  Br   