ó
 m[c           @` s¨   d  d l  m Z m Z m Z m Z d  d l Z d  d l j Z d  d l j	 Z
 d e f d „  ƒ  YZ d e f d „  ƒ  YZ d e f d „  ƒ  YZ d	 e f d
 „  ƒ  YZ d S(   i    (   t   absolute_importt   divisiont   print_functiont   unicode_literalsNt	   Containerc           B` s}   e  Z d  Z d „  Z d „  Z d d „ Z d „  Z d „  Z d „  Z	 d „  Z
 d „  Z d	 „  Z d
 „  Z d „  Z d „  Z RS(   uŽ   
    Base class for containers.

    Containers are classes that collect semantically related Artists such as
    the bars of a bar plot.
    c         C` s   d j  t |  ƒ j t |  ƒ ƒ S(   Nu   <{} object of {} artists>(   t   formatt   typet   __name__t   len(   t   self(    (    s3   lib/python2.7/site-packages/matplotlib/container.pyt   __repr__   s    c         O` s   t  j |  | d ƒ S(   Ni    (   t   tuplet   __new__(   t   clst   klt   kwargs(    (    s3   lib/python2.7/site-packages/matplotlib/container.pyR      s    c         C` s5   t  |  _ d |  _ i  |  _ d  |  _ |  j | ƒ d  S(   Ni    (   t   Falset   eventsont   _oidt   _propobserverst   Nonet   _remove_methodt	   set_label(   R	   R   t   label(    (    s3   lib/python2.7/site-packages/matplotlib/container.pyt   __init__   s
    				c         C` s   | |  _  d  S(   N(   R   (   R	   t   f(    (    s3   lib/python2.7/site-packages/matplotlib/container.pyt   set_remove_method#   s    c         C` sY   x9 t  j |  d d „  ƒD] } | d  k	 r | j ƒ  q q W|  j rU |  j |  ƒ n  d  S(   Nt   scalarpc         S` s   t  |  t j ƒ S(   N(   t
   isinstancet   martistt   Artist(   t   x(    (    s3   lib/python2.7/site-packages/matplotlib/container.pyt   <lambda>(   s    (   t   cbookt   flattenR   t   removeR   (   R	   t   c(    (    s3   lib/python2.7/site-packages/matplotlib/container.pyR#   &   s    		c         C` s   |  j  j ƒ  } d  | d <| S(   Nu   _remove_method(   t   __dict__t   copyR   (   R	   t   d(    (    s3   lib/python2.7/site-packages/matplotlib/container.pyt   __getstate__/   s    
c         C` s   |  j  S(   uC   
        Get the label used for this artist in the legend.
        (   t   _label(   R	   (    (    s3   lib/python2.7/site-packages/matplotlib/container.pyt	   get_label6   s    c         C` s6   | d k	 r d | f |  _ n	 d |  _ |  j ƒ  d S(   u|   
        Set the label to *s* for auto legend.

        ACCEPTS: string or anything printable with '%s' conversion.
        u   %sN(   R   R)   t   pchanged(   R	   t   s(    (    s3   lib/python2.7/site-packages/matplotlib/container.pyR   <   s    	c         C` s)   |  j  } | |  j | <|  j  d 7_  | S(   uî   
        Adds a callback function that will be called whenever one of
        the :class:`Artist`'s properties changes.

        Returns an *id* that is useful for removing the callback with
        :meth:`remove_callback` later.
        i   (   R   R   (   R	   t   funct   oid(    (    s3   lib/python2.7/site-packages/matplotlib/container.pyt   add_callbackH   s    	c         C` s&   y |  j  | =Wn t k
 r! n Xd S(   u“   
        Remove a callback based on its *id*.

        .. seealso::

            :meth:`add_callback`
               For adding callbacks

        N(   R   t   KeyError(   R	   R.   (    (    s3   lib/python2.7/site-packages/matplotlib/container.pyt   remove_callbackU   s    
c         C` s7   x0 t  t j |  j ƒ ƒ D] \ } } | |  ƒ q Wd S(   ug   
        Fire an event when property changed, calling all of the
        registered callbacks.
        N(   t   listt   sixt	   iteritemsR   (   R	   R.   R-   (    (    s3   lib/python2.7/site-packages/matplotlib/container.pyR+   d   s    %c         C` s,   g  t  j |  ƒ D] } | d  k	 r | ^ q S(   N(   R!   R"   R   (   R	   t   child(    (    s3   lib/python2.7/site-packages/matplotlib/container.pyt   get_childrenl   s    N(   R   t
   __module__t   __doc__R
   R   R   R   R   R#   R(   R*   R   R/   R1   R+   R6   (    (    (    s3   lib/python2.7/site-packages/matplotlib/container.pyR   
   s   		
									t   BarContainerc           B` s   e  Z d  Z d d „ Z RS(   u  
    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.

    c         K` s)   | |  _  | |  _ t j |  | |  d  S(   N(   t   patchest   errorbarR   R   (   R	   R:   R;   R   (    (    s3   lib/python2.7/site-packages/matplotlib/container.pyR   ƒ   s    		N(   R   R7   R8   R   R   (    (    (    s3   lib/python2.7/site-packages/matplotlib/container.pyR9   p   s   t   ErrorbarContainerc           B` s   e  Z d  Z e e d „ Z RS(   u  
    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         K` s2   | |  _  | |  _ | |  _ t j |  | |  d  S(   N(   t   linest   has_xerrt   has_yerrR   R   (   R	   R=   R>   R?   R   (    (    s3   lib/python2.7/site-packages/matplotlib/container.pyR   ¢   s    			(   R   R7   R8   R   R   (    (    (    s3   lib/python2.7/site-packages/matplotlib/container.pyR<   ‰   s   t   StemContainerc           B` s   e  Z d  Z d „  Z RS(   u  
    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         K` sA   | \ } } } | |  _  | |  _ | |  _ t j |  | |  d  S(   N(   t
   markerlinet	   stemlinest   baselineR   R   (   R	   t   markerline_stemlines_baselineR   RA   RB   RC   (    (    s3   lib/python2.7/site-packages/matplotlib/container.pyR   ½   s
    			(   R   R7   R8   R   (    (    (    s3   lib/python2.7/site-packages/matplotlib/container.pyR@   ©   s   (   t
   __future__R    R   R   R   R3   t   matplotlib.cbookR!   t   matplotlib.artistt   artistR   R   R   R9   R<   R@   (    (    (    s3   lib/python2.7/site-packages/matplotlib/container.pyt   <module>   s   "f 