
 m[c           @` sx  d  d l  m Z m Z m Z m Z d  d l Z d  d l m Z m Z d  d l	 m
 Z
 d  d l Z d  d l Z d  d l Z d  d l Z d  d l Z d d l m Z m Z m Z d d l m Z d d l m Z m Z m Z m Z m Z m Z d	   Z d
   Z e d d  Z  d e! f d     YZ" d e! f d     YZ# e$ d  Z% e% Z& d   Z' d   Z( e j) j* d e( e"   d S(   i    (   t   absolute_importt   divisiont   print_functiont   unicode_literalsN(   t   OrderedDictt
   namedtuple(   t   wrapsi   (   t   cbookt	   docstringt   rcParams(   t   Path(   t   Bboxt   IdentityTransformt	   Transformt   TransformedBboxt   TransformedPatchPatht   TransformedPathc         ` s(   t       f d    } t | _ | S(   u-  
    Decorator for Artist.draw method. Provides routines
    that run before and after the draw call. The before and after functions
    are useful for changing artist-dependent renderer attributes or making
    other setup function calls, such as starting and flushing a mixed-mode
    renderer.
    c         ` s   zO |  j    r | j   n  |  j   d  k	 r; | j   n    |  | | |  SWd  |  j   d  k	 rz | j |  j    n  |  j    r | j   n  Xd  S(   N(   t   get_rasterizedt   start_rasterizingt   get_agg_filtert   Nonet   start_filtert   stop_filtert   stop_rasterizing(   t   artistt   renderert   argst   kwargs(   t   draw(    s0   lib/python2.7/site-packages/matplotlib/artist.pyt   draw_wrapper/   s    (   R   t   Truet   _supports_rasterization(   R   R   (    (   R   s0   lib/python2.7/site-packages/matplotlib/artist.pyt   allow_rasterization%   s    
	c         C` s   |  j  r | |  j  _ n  d  S(   N(   t   axest   stale(   t   selft   val(    (    s0   lib/python2.7/site-packages/matplotlib/artist.pyt   _stale_axes_callbackB   s    	u   _XYPairu   x yt   Artistc           B` s  e  Z d  Z d Z d Z e d d  Z d   Z d   Z d   Z	 d   Z
 d	   Z d
   Z e d    Z e j d    Z e d    Z e j d    Z d   Z d   Z d   Z d   Z d   Z d   Z d   Z e j d  d    Z d   Z d   Z d   Z d   Z d   Z d   Z  d   Z! d   Z" e j d d   d!    Z# d"   Z$ d#   Z% d$   Z& d%   Z' d&   Z( d'   Z) d(   Z* dO dO dO d)  Z, d*   Z- d+   Z. d,   Z/ d-   Z0 d.   Z1 dO d/  Z2 d0   Z3 d1   Z4 d2   Z5 d3   Z6 d4   Z7 d5   Z8 d6   Z9 d7   Z: d8   Z; d9   Z< d:   Z= d;   Z> d<   Z? d=   Z@ d>   ZA d?   ZB d@   ZC dA   ZD dB   ZE dC   ZF dD   ZG dE   ZH e dF    ZI dG   ZJ dH   ZK dI   ZL dO eM dJ  ZN dK   ZO dL   ZP e dM    ZQ eQ j dN    ZQ RS(P   uW   
    Abstract base class for someone who renders into a
    :class:`FigureCanvas`.
    u   Artisti    t   coloric         C` s2  t  |  _ d  |  _ d  |  _ d  |  _ d  |  _ t |  _ t  |  _	 t |  _
 d  |  _ d  |  _ d  |  _ t  |  _ d |  _ d  |  _ d  |  _ d  |  _ d  |  _ t |  _ t |  _ d |  _ i  |  _ y d  |  _ Wn t k
 r n Xd  |  _ d  |  _ d  |  _ d  |  _ t d |  _ t d |  _  t! g  g   |  _" d  S(   Nu    i    u   path.sketchu   path.effects(#   R   t   _staleR   t   stale_callbackt   _axest   figuret
   _transformt   Falset   _transformSett   _visiblet	   _animatedt   _alphat   clipboxt	   _clippatht   _clipont   _labelt   _pickert	   _containst   _rasterizedt   _agg_filtert
   _mouseovert   eventsont   _oidt   _propobserversR!   t   AttributeErrort   _remove_methodt   _urlt   _gidt   _snapR	   t   _sketcht   _path_effectst   _XYPairt   _sticky_edges(   R#   (    (    s0   lib/python2.7/site-packages/matplotlib/artist.pyt   __init__W   s@    																									c         C` s'   |  j  j   } d  | d <d  | d <| S(   Nu   _remove_methodu   stale_callback(   t   __dict__t   copyR   (   R#   t   d(    (    s0   lib/python2.7/site-packages/matplotlib/artist.pyt   __getstate__{   s    

c         C` s   |  j  d k	 r |  j  |   d |  _ t } t |  d  rt |  j rt |  j j j |   t |  j _	 d |  _ t } n  |  j
 r d |  _
 | s t |  _
 q q n t d   d S(   u  
        Remove the artist from the figure if possible.  The effect
        will not be visible until the figure is redrawn, e.g., with
        :meth:`matplotlib.axes.Axes.draw_idle`.  Call
        :meth:`matplotlib.axes.Axes.relim` to update the axes limits
        if desired.

        Note: :meth:`~matplotlib.axes.Axes.relim` will not see
        collections even if the collection was added to axes with
        *autolim* = True.

        Note: there is no support for removing the artist's legend entry.
        u   axesu   cannot remove artistN(   R?   R   R)   R-   t   hasattrR!   t   mouseover_sett   discardR   R"   R+   t   NotImplementedError(   R#   t   _ax_flag(    (    s0   lib/python2.7/site-packages/matplotlib/artist.pyt   remove   s    					c         C` sD   |  j  } | d k s$ | j d k r( t S| j j   pC | j j   S(   u5   Return *True* if units are set on the *x* or *y* axesN(   R!   R   t   xaxisR-   t
   have_unitst   yaxis(   R#   t   ax(    (    s0   lib/python2.7/site-packages/matplotlib/artist.pyRS      s    	c         C` sA   t  |  d d  } | d k s- | j d k r1 | S| j j |  S(   uj   For artists in an axes, if the xaxis has units support,
        convert *x* using xaxis unit type
        u   axesN(   t   getattrR   RR   t   convert_units(   R#   t   xRU   (    (    s0   lib/python2.7/site-packages/matplotlib/artist.pyt   convert_xunits   s    c         C` sA   t  |  d d  } | d k s- | j d k r1 | S| j j |  S(   uj   For artists in an axes, if the yaxis has units support,
        convert *y* using yaxis unit type
        u   axesN(   RV   R   RT   RW   (   R#   t   yRU   (    (    s0   lib/python2.7/site-packages/matplotlib/artist.pyt   convert_yunits   s    c         C` s   |  j  S(   ug   
        The :class:`~matplotlib.axes.Axes` instance the artist
        resides in, or *None*.
        (   R*   (   R#   (    (    s0   lib/python2.7/site-packages/matplotlib/artist.pyR!      s    c         C` sj   | d  k	 r9 |  j d  k	 r9 | |  j k r9 t d   n  | |  _ | d  k	 rf | |  k	 rf t |  _ n  | S(   Nuq   Can not reset the axes.  You are probably trying to re-use an artist in more than one Axes which is not supported(   R   R*   t
   ValueErrorR%   R)   (   R#   t   new_axes(    (    s0   lib/python2.7/site-packages/matplotlib/artist.pyR!      s    	c         C` s   |  j  S(   u   
        If the artist is 'stale' and needs to be re-drawn for the output to
        match the internal state of the artist.
        (   R(   (   R#   (    (    s0   lib/python2.7/site-packages/matplotlib/artist.pyR"      s    c         C` sE   | |  _  |  j   r d  S| rA |  j d  k	 rA |  j |  |  n  d  S(   N(   R(   t   get_animatedR)   R   (   R#   R$   (    (    s0   lib/python2.7/site-packages/matplotlib/artist.pyR"      s
    	c         C` s   t  d d g d d g g  S(   u  
        Get the axes bounding box in display space.
        Subclasses should override for inclusion in the bounding box
        "tight" calculation. Default is to return an empty bounding
        box at 0, 0.

        Be careful when using this function, the results will not update
        if the artist window extent of the artist changes.  The extent
        can change due to any changes in the transform stack, such as
        changing the axes limits, the figure size, or the canvas used
        (as is done when saving a figure).  This can lead to unexpected
        behavior where interactive figures will look fine on the screen,
        but will save incorrectly.
        i    (   R   (   R#   R   (    (    s0   lib/python2.7/site-packages/matplotlib/artist.pyt   get_window_extent   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(    (    s0   lib/python2.7/site-packages/matplotlib/artist.pyt   add_callback  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#   Ra   (    (    s0   lib/python2.7/site-packages/matplotlib/artist.pyt   remove_callback  s    
c         C` s1   x* t  j |  j  D] \ } } | |   q Wd S(   ug   
        Fire an event when property changed, calling all of the
        registered callbacks.
        N(   t   sixt	   iteritemsR=   (   R#   Ra   R`   (    (    s0   lib/python2.7/site-packages/matplotlib/artist.pyt   pchanged   s    c         C` s   |  j  S(   u[   
        Returns *True* if :class:`Artist` has a transform explicitly
        set.
        (   R.   (   R#   (    (    s0   lib/python2.7/site-packages/matplotlib/artist.pyt   is_transform_set(  s    c         C` s)   | |  _  t |  _ |  j   t |  _ d S(   u   
        Set the artist transform.

        Parameters
        ----------
        t : `.Transform`
            .. ACCEPTS: `.Transform`
        N(   R,   R   R.   Rg   R"   (   R#   t   t(    (    s0   lib/python2.7/site-packages/matplotlib/artist.pyt   set_transform/  s    			
c         C` se   |  j  d k r t   |  _  n@ t |  j  t  r^ t |  j  d  r^ |  j  j |  j  |  _  n  |  j  S(   ul   
        Return the :class:`~matplotlib.transforms.Transform`
        instance used by this artist.
        u   _as_mpl_transformN(   R,   R   R   t
   isinstanceR   RL   t   _as_mpl_transformR!   (   R#   (    (    s0   lib/python2.7/site-packages/matplotlib/artist.pyt   get_transform=  s    u   2.2c         C` s   g  } y/ |  j  |  \ } } | r4 | j |   n  Wn- d d l } | j   t d |  j  n Xx* |  j   D] } | j | j |   qr W| S(   uX   
        List the children of the artist which contain the mouse event *event*.
        i    Nu   while checking(	   t   containst   appendt	   tracebackt	   print_exct   printt	   __class__t   get_childrent   extendt   hitlist(   R#   t   eventt   Lt	   hascursort   infoRp   t   a(    (    s0   lib/python2.7/site-packages/matplotlib/artist.pyRv   I  s    
c         C` s   g  S(   ud   
        Return a list of the child :class:`Artist`s this
        :class:`Artist` contains.
        (    (   R#   (    (    s0   lib/python2.7/site-packages/matplotlib/artist.pyRt   \  s    c         C` s@   t  |  j  r |  j |  |  St j d |  j j  t i  f S(   u  Test whether the artist contains the mouse event.

        Returns the truth value and a dictionary of artist specific details of
        selection, such as which points are contained in the pick radius.  See
        individual artists for details.
        u   '%s' needs 'contains' method(   t   callableR7   t   warningst   warnRs   t   __name__R-   (   R#   t
   mouseevent(    (    s0   lib/python2.7/site-packages/matplotlib/artist.pyRn   c  s    c         C` s   | |  _  d S(   u	  
        Replace the contains test used by this artist. The new picker
        should be a callable function which determines whether the
        artist is hit by the mouse event::

            hit, props = picker(artist, mouseevent)

        If the mouse event is over the artist, return *hit* = *True*
        and *props* is a dictionary of properties you want returned
        with the contains test.

        Parameters
        ----------
        picker : callable
            .. ACCEPTS: a callable function
        N(   R7   (   R#   t   picker(    (    s0   lib/python2.7/site-packages/matplotlib/artist.pyt   set_containso  s    c         C` s   |  j  S(   uV   
        Return the _contains test used by the artist, or *None* for default.
        (   R7   (   R#   (    (    s0   lib/python2.7/site-packages/matplotlib/artist.pyt   get_contains  s    c         C` s.   |  j  d k	 o- |  j  j d k	 o- |  j d k	 S(   u-   Return *True* if :class:`Artist` is pickable.N(   R+   R   t   canvasR6   (   R#   (    (    s0   lib/python2.7/site-packages/matplotlib/artist.pyt   pickable  s    c         C` s   |  j    rv |  j   } t |  r< | |  |  \ } } n |  j |  \ } } | rv |  j j j | |  |  qv n  x` |  j   D]R } t | d d  } | j
 d k s | d k s | j
 | k r | j |  q q Wd S(   u   
        Process pick event

        each child artist will fire a pick event if *mouseevent* is over
        the artist and the artist has picker set
        u   axesN(   R   t
   get_pickerR|   Rn   R+   R   t
   pick_eventRt   RV   R   t   inaxest   pick(   R#   R   R   t   insidet   propR{   RU   (    (    s0   lib/python2.7/site-packages/matplotlib/artist.pyR     s    c         C` s   | |  _  d S(   uU  
        Set the epsilon for picking used by this artist

        *picker* can be one of the following:

          * *None*: picking is disabled for this artist (default)

          * A boolean: if *True* then picking will be enabled and the
            artist will fire a pick event if the mouse event is over
            the artist

          * A float: if picker is a number it is interpreted as an
            epsilon tolerance in points and the artist will fire
            off an event if it's data is within epsilon of the mouse
            event.  For some artists like lines and patch collections,
            the artist may provide additional data to the pick event
            that is generated, e.g., the indices of the data within
            epsilon of the pick event

          * A function: if picker is callable, it is a user supplied
            function which determines whether the artist is hit by the
            mouse event::

              hit, props = picker(artist, mouseevent)

            to determine the hit test.  if the mouse event is over the
            artist, return *hit=True* and props is a dictionary of
            properties you want added to the PickEvent attributes.

        Parameters
        ----------
        picker : None or bool or float or callable
            .. ACCEPTS: [None | bool | float | callable]
        N(   R6   (   R#   R   (    (    s0   lib/python2.7/site-packages/matplotlib/artist.pyt
   set_picker  s    #c         C` s   |  j  S(   u-   Return the picker object used by this artist.(   R6   (   R#   (    (    s0   lib/python2.7/site-packages/matplotlib/artist.pyR     s    u   artist.figure is not Nonec         C` s   |  j  d k	 S(   u6   Returns whether the artist is assigned to a `.Figure`.N(   R+   R   (   R#   (    (    s0   lib/python2.7/site-packages/matplotlib/artist.pyt   is_figure_set  s    c         C` s   |  j  S(   u   Returns the url.(   R@   (   R#   (    (    s0   lib/python2.7/site-packages/matplotlib/artist.pyt   get_url  s    c         C` s   | |  _  d S(   u   
        Sets the url for the artist.

        Parameters
        ----------
        url : str
            .. ACCEPTS: a url string
        N(   R@   (   R#   t   url(    (    s0   lib/python2.7/site-packages/matplotlib/artist.pyt   set_url  s    	c         C` s   |  j  S(   u   Returns the group id.(   RA   (   R#   (    (    s0   lib/python2.7/site-packages/matplotlib/artist.pyt   get_gid  s    c         C` s   | |  _  d S(   u   
        Sets the (group) id for the artist.

        Parameters
        ----------
        gid : str
            .. ACCEPTS: an id string
        N(   RA   (   R#   t   gid(    (    s0   lib/python2.7/site-packages/matplotlib/artist.pyt   set_gid  s    	c         C` s   t  d r |  j St Sd S(   uS  
        Returns the snap setting which may be:

          * True: snap vertices to the nearest pixel center

          * False: leave vertices as-is

          * None: (auto) If the path contains only rectilinear line
            segments, round to the nearest pixel center

        Only supported by the Agg and MacOSX backends.
        u	   path.snapN(   R	   RB   R-   (   R#   (    (    s0   lib/python2.7/site-packages/matplotlib/artist.pyt   get_snap  s    
c         C` s   | |  _  t |  _ d S(   u  
        Sets the snap setting which may be:

          * True: snap vertices to the nearest pixel center

          * False: leave vertices as-is

          * None: (auto) If the path contains only rectilinear line
            segments, round to the nearest pixel center

        Only supported by the Agg and MacOSX backends.

        Parameters
        ----------
        snap : bool or None
            .. ACCEPTS: bool or None
        N(   RB   R   R"   (   R#   t   snap(    (    s0   lib/python2.7/site-packages/matplotlib/artist.pyt   set_snap  s    	c         C` s   |  j  S(   u  
        Returns the sketch parameters for the artist.

        Returns
        -------
        sketch_params : tuple or `None`

        A 3-tuple with the following elements:

          * `scale`: The amplitude of the wiggle perpendicular to the
            source line.

          * `length`: The length of the wiggle along the line.

          * `randomness`: The scale factor by which the length is
            shrunken or expanded.

        May return `None` if no sketch parameters were set.
        (   RC   (   R#   (    (    s0   lib/python2.7/site-packages/matplotlib/artist.pyt   get_sketch_params   s    c         C` sC   | d k r d |  _ n | | p$ d | p- d f |  _ t |  _ d S(   u~  
        Sets the sketch parameters.

        Parameters
        ----------

        scale : float, optional
            The amplitude of the wiggle perpendicular to the source
            line, in pixels.  If scale is `None`, or not provided, no
            sketch filter will be provided.

        length : float, optional
             The length of the wiggle along the line, in pixels
             (default 128.0)

        randomness : float, optional
            The scale factor by which the length is shrunken or
            expanded (default 16.0)

            .. ACCEPTS: (scale: float, length: float, randomness: float)
        g      `@g      0@N(   R   RC   R   R"   (   R#   t   scalet   lengtht
   randomness(    (    s0   lib/python2.7/site-packages/matplotlib/artist.pyt   set_sketch_params6  s    c         C` s   | |  _  t |  _ d S(   u   Set the path effects.

        Parameters
        ----------
        path_effects : `.AbstractPathEffect`
            .. ACCEPTS: `.AbstractPathEffect`
        N(   RD   R   R"   (   R#   t   path_effects(    (    s0   lib/python2.7/site-packages/matplotlib/artist.pyt   set_path_effectsR  s    	c         C` s   |  j  S(   N(   RD   (   R#   (    (    s0   lib/python2.7/site-packages/matplotlib/artist.pyt   get_path_effects]  s    c         C` s   |  j  S(   u4   Return the `.Figure` instance the artist belongs to.(   R+   (   R#   (    (    s0   lib/python2.7/site-packages/matplotlib/artist.pyt
   get_figure`  s    c         C` sl   |  j  | k r d S|  j  d k	 r1 t d   n  | |  _  |  j  r_ |  j  |  k	 r_ |  j   n  t |  _ d S(   u   
        Set the `.Figure` instance the artist belongs to.

        Parameters
        ----------
        fig : `.Figure`
            .. ACCEPTS: a `.Figure` instance
        Nu1   Can not put single artist in more than one figure(   R+   R   t   RuntimeErrorRg   R   R"   (   R#   t   fig(    (    s0   lib/python2.7/site-packages/matplotlib/artist.pyt
   set_figured  s    
	c         C` s    | |  _  |  j   t |  _ d S(   u   
        Set the artist's clip `.Bbox`.

        Parameters
        ----------
        clipbox : `.Bbox`
            .. ACCEPTS: a `.Bbox` instance
        N(   R2   Rg   R   R"   (   R#   R2   (    (    s0   lib/python2.7/site-packages/matplotlib/artist.pyt   set_clip_box}  s    		
c         C` s  d d l  m } m } t } | d k r t | |  rg t t j   | j	    |  _
 d |  _ t } q t | |  r t |  |  _ t } q t | t  r | \ } } q n  | d k r d |  _ t } nl t | t  r t | |  |  _ t } nB t | t  r| |  _ t } n! t | t  r9| |  _ t } n  | slt d j t |  j t |  j    n  |  j   t |  _ d S(   u  
        Set the artist's clip path, which may be:

        - a :class:`~matplotlib.patches.Patch` (or subclass) instance; or
        - a :class:`~matplotlib.path.Path` instance, in which case a
          :class:`~matplotlib.transforms.Transform` instance, which will be
          applied to the path before using it for clipping, must be provided;
          or
        - ``None``, to remove a previously set clipping path.

        For efficiency, if the path happens to be an axis-aligned rectangle,
        this method will set the clipping box to the corresponding rectangle
        and set the clipping path to ``None``.

        ACCEPTS: [(`~matplotlib.path.Path`, `.Transform`) | `.Patch` | None]
        i    (   t   Patcht	   Rectangleu5   Invalid arguments to set_clip_path, of type {} and {}N(   t   matplotlib.patchesR   R   R-   R   Rk   R   R   t   unitRm   R2   R3   R   R   t   tupleR
   R   t	   TypeErrort   formatt   typeR   Rg   R"   (   R#   t   patht	   transformR   R   t   success(    (    s0   lib/python2.7/site-packages/matplotlib/artist.pyt   set_clip_path  s>    										$
c         C` s   |  j  S(   ub   
        Return the alpha value used for blending - not supported on all
        backends
        (   R1   (   R#   (    (    s0   lib/python2.7/site-packages/matplotlib/artist.pyt	   get_alpha  s    c         C` s   |  j  S(   u   Return the artist's visiblity(   R/   (   R#   (    (    s0   lib/python2.7/site-packages/matplotlib/artist.pyt   get_visible  s    c         C` s   |  j  S(   u"   Return the artist's animated state(   R0   (   R#   (    (    s0   lib/python2.7/site-packages/matplotlib/artist.pyR^     s    c         C` s   |  j  S(   u#   Return whether artist uses clipping(   R4   (   R#   (    (    s0   lib/python2.7/site-packages/matplotlib/artist.pyt   get_clip_on  s    c         C` s   |  j  S(   u   Return artist clipbox(   R2   (   R#   (    (    s0   lib/python2.7/site-packages/matplotlib/artist.pyt   get_clip_box  s    c         C` s   |  j  S(   u   Return artist clip path(   R3   (   R#   (    (    s0   lib/python2.7/site-packages/matplotlib/artist.pyt   get_clip_path  s    c         C` s    |  j  d k	 r |  j  j   Sd S(   u   
        Return the clip path with the non-affine part of its
        transformation applied, and the remaining affine part of its
        transformation.
        N(   NN(   R3   R   t   get_transformed_path_and_affine(   R#   (    (    s0   lib/python2.7/site-packages/matplotlib/artist.pyt$   get_transformed_clip_path_and_affine  s    c         C` s    | |  _  |  j   t |  _ d S(   u   
        Set whether artist uses clipping.

        When False artists will be visible out side of the axes which
        can lead to unexpected results.

        Parameters
        ----------
        b : bool
            .. ACCEPTS: bool
        N(   R4   Rg   R   R"   (   R#   t   b(    (    s0   lib/python2.7/site-packages/matplotlib/artist.pyt   set_clip_on  s    	
c         C` s\   |  j  r> |  j d k	 r+ | j |  j  n  | j |  j  n | j d  | j d  d S(   u    Set the clip properly for the gcN(   R4   R2   R   t   set_clip_rectangleR   R3   (   R#   t   gc(    (    s0   lib/python2.7/site-packages/matplotlib/artist.pyt   _set_gc_clip  s    	c         C` s   |  j  S(   u.   Return whether the artist is to be rasterized.(   R8   (   R#   (    (    s0   lib/python2.7/site-packages/matplotlib/artist.pyR     s    c         C` s:   | r- t  |  j d  r- t j d |   n  | |  _ d S(   u  
        Force rasterized (bitmap) drawing in vector backend output.

        Defaults to None, which implies the backend's default behavior.

        Parameters
        ----------
        rasterized : bool or None
            .. ACCEPTS: bool or None
        u   _supports_rasterizationu%   Rasterization of '%s' will be ignoredN(   RL   R   R}   R~   R8   (   R#   t
   rasterized(    (    s0   lib/python2.7/site-packages/matplotlib/artist.pyt   set_rasterized  s    c         C` s   |  j  S(   u1   Return filter function to be used for agg filter.(   R9   (   R#   (    (    s0   lib/python2.7/site-packages/matplotlib/artist.pyR     s    c         C` s   | |  _  t |  _ d S(   up  Set the agg filter.

        Parameters
        ----------
        filter_func : callable
            A filter function, which takes a (m, n, 3) float array and a dpi
            value, and returns a (m, n, 3) array.

            .. ACCEPTS: a filter function, which takes a (m, n, 3) float array
                and a dpi value, and returns a (m, n, 3) array
        N(   R9   R   R"   (   R#   t   filter_func(    (    s0   lib/python2.7/site-packages/matplotlib/artist.pyt   set_agg_filter  s    	c         O` s   |  j    s d St |  _ d S(   u   Derived classes drawing methodN(   R   R-   R"   (   R#   R   R   R   (    (    s0   lib/python2.7/site-packages/matplotlib/artist.pyR   (  s    c         C` s    | |  _  |  j   t |  _ d S(   u   
        Set the alpha value used for blending - not supported on
        all backends.

        Parameters
        ----------
        alpha : float
            .. ACCEPTS: float (0.0 transparent through 1.0 opaque)
        N(   R1   Rg   R   R"   (   R#   t   alpha(    (    s0   lib/python2.7/site-packages/matplotlib/artist.pyt	   set_alpha.  s    
	
c         C` s    | |  _  |  j   t |  _ d S(   u   
        Set the artist's visibility.

        Parameters
        ----------
        b : bool
            .. ACCEPTS: bool
        N(   R/   Rg   R   R"   (   R#   R   (    (    s0   lib/python2.7/site-packages/matplotlib/artist.pyt   set_visible<  s    		
c         C` s)   |  j  | k r% | |  _  |  j   n  d S(   u   
        Set the artist's animation state.

        Parameters
        ----------
        b : bool
            .. ACCEPTS: bool
        N(   R0   Rg   (   R#   R   (    (    s0   lib/python2.7/site-packages/matplotlib/artist.pyt   set_animatedI  s    		c         C` s   d   } |  j  } t |  _  z5 g  | j   D] \ } } | |  | |  ^ q+ } Wd | |  _  Xt |  r |  j   t |  _ n  | S(   uM   
        Update this artist's properties from the dictionary *prop*.
        c         S` sn   | j    } | d h k r+ t |  | |  St |  d | d  } t |  s` t d |   n  | |  Sd S(   u  Sorting out how to update property (setter or setattr).

            Parameters
            ----------
            k : str
                The name of property to update
            v : obj
                The value to assign to the property

            Returns
            -------
            ret : obj or None
                If using a `set_*` method return it's return, else None.
            u   axesu   set_u   Unknown property %sN(   t   lowert   setattrRV   R   R|   R>   (   R#   t   kt   vR`   (    (    s0   lib/python2.7/site-packages/matplotlib/artist.pyt   _update_propertyZ  s    N(   R;   R-   t   itemst   lenRg   R   R"   (   R#   t   propsR   t   storeR   R   t   ret(    (    s0   lib/python2.7/site-packages/matplotlib/artist.pyt   updateV  s    			2

c         C` s   |  j  S(   u1   Get the label used for this artist in the legend.(   R5   (   R#   (    (    s0   lib/python2.7/site-packages/matplotlib/artist.pyt	   get_label  s    c         C` sA   | d k	 r! t j |  |  _ n	 d |  _ |  j   t |  _ d S(   u   
        Set the label to *s* for auto legend.

        Parameters
        ----------
        s : object
            *s* will be converted to a string by calling `str` (`unicode` on
            Py2).

            .. ACCEPTS: object
        N(   R   Re   t	   text_typeR5   Rg   R   R"   (   R#   t   s(    (    s0   lib/python2.7/site-packages/matplotlib/artist.pyt	   set_label  s
    	
c         C` s   |  j  S(   u   Return the artist's zorder.(   t   zorder(   R#   (    (    s0   lib/python2.7/site-packages/matplotlib/artist.pyt
   get_zorder  s    c         C` s;   | d k r |  j j } n  | |  _ |  j   t |  _ d S(   u   
        Set the zorder for the artist.  Artists with lower zorder
        values are drawn first.

        Parameters
        ----------
        level : float
            .. ACCEPTS: float
        N(   R   Rs   R   Rg   R   R"   (   R#   t   level(    (    s0   lib/python2.7/site-packages/matplotlib/artist.pyt
   set_zorder  s
    
	
c         C` s   |  j  S(   u}  
        `x` and `y` sticky edge lists.

        When performing autoscaling, if a data limit coincides with a value in
        the corresponding sticky_edges list, then no margin will be added--the
        view limit "sticks" to the edge. A typical usecase is histograms,
        where one usually expects no margin on the bottom edge (0) of the
        histogram.

        This attribute cannot be assigned to; however, the `x` and `y` lists
        can be modified in place as needed.

        Examples
        --------

        >>> artist.sticky_edges.x[:] = (xmin, xmax)
        >>> artist.sticky_edges.y[:] = (ymin, ymax)

        (   RF   (   R#   (    (    s0   lib/python2.7/site-packages/matplotlib/artist.pyt   sticky_edges  s    c         C` s   | j  |  _  | j |  _ | j |  _ | j |  _ | j |  _ | j |  _ | j |  _ | j |  _ | j |  _ | j	 |  _	 | j
 j |  j
 j (| j
 j |  j
 j (|  j   t |  _ d S(   u'   Copy properties from *other* to *self*.N(   R,   R.   R/   R1   R2   R4   R3   R5   RC   RD   R   RX   RZ   Rg   R   R"   (   R#   t   other(    (    s0   lib/python2.7/site-packages/matplotlib/artist.pyt   update_from  s    
c         C` s   t  |   j   S(   uY   
        return a dictionary mapping property name -> value for all Artist props
        (   t   ArtistInspectort
   properties(   R#   (    (    s0   lib/python2.7/site-packages/matplotlib/artist.pyR     s    c         ` s:   t  t | j   d t d   f d    }   j |  S(   uB   A property batch setter. Pass *kwargs* to set properties.
        t   reverset   keyc         ` s!     j  j |  d d  |  d f S(   Ni    (   t   _prop_ordert   get(   RX   (   R#   (    s0   lib/python2.7/site-packages/matplotlib/artist.pyt   <lambda>  s    (   R   t   sortedR   R   R   (   R#   R   R   (    (   R#   s0   lib/python2.7/site-packages/matplotlib/artist.pyt   set  s    c         ` s     d k r d   } nQ t   t  rH t   t  rH   f d   } n! t    r]   } n t d   t g  |  j   D] } | j	 |  ^ qy g   } | r | |   r | j
 |   n  | S(   u  
        Find artist objects.

        Recursively find all :class:`~matplotlib.artist.Artist` instances
        contained in self.

        *match* can be

          - None: return all objects contained in artist.

          - function with signature ``boolean = match(artist)``
            used to filter matches

          - class instance: e.g., Line2D.  Only return artists of class type.

        If *include_self* is True (default), include self in the list to be
        checked for a match.

        c         S` s   t  S(   N(   R   (   RX   (    (    s0   lib/python2.7/site-packages/matplotlib/artist.pyt	   matchfunc  s    c         ` s   t  |     S(   N(   Rk   (   RX   (   t   match(    s0   lib/python2.7/site-packages/matplotlib/artist.pyR     s    uF   match must be None, a matplotlib.artist.Artist subclass, or a callableN(   R   Rk   R   t
   issubclassR&   R|   R\   t   sumRt   t   findobjRo   (   R#   R   t   include_selfR   t   ct   artists(    (   R   s0   lib/python2.7/site-packages/matplotlib/artist.pyR     s    	1c         C` s   d S(   u8   
        Get the cursor data for a given event.
        N(   R   (   R#   Rw   (    (    s0   lib/python2.7/site-packages/matplotlib/artist.pyt   get_cursor_data  s    c         C` sF   y | d Wn  t  t f k
 r. | g } n Xd j d   | D  S(   u8   
        Return *cursor data* string formatted.
        i    u   , c         s` s?   |  ]5 } t  | t j t j t t f  r d  j |  Vq d S(   u   {:0.3g}N(   Rk   t   npt   floatingt   integert   intt   floatR   (   t   .0t   item(    (    s0   lib/python2.7/site-packages/matplotlib/artist.pys	   <genexpr>  s    (   R   t
   IndexErrort   join(   R#   t   data(    (    s0   lib/python2.7/site-packages/matplotlib/artist.pyt   format_cursor_data  s
    c         C` s   |  j  S(   N(   R:   (   R#   (    (    s0   lib/python2.7/site-packages/matplotlib/artist.pyt	   mouseover  s    c         C` sT   t  |  } | |  _ |  j } | rP | r= | j j |   qP | j j |   n  d  S(   N(   t   boolR:   R!   RM   t   addRN   (   R#   R$   RU   (    (    s0   lib/python2.7/site-packages/matplotlib/artist.pyR     s    		N(R   R   t
   __module__t   __doc__t   anameR   t   dictR   RG   RK   RQ   RS   RY   R[   t   propertyR!   t   setterR"   R_   Rb   Rd   Rg   Rh   Rj   Rm   R   t
   deprecatedRv   Rt   Rn   R   R   R   R   R   R   R   R   R   R   R   R   R   R   R   R   R   R   R   R   R   R   R   R   R^   R   R   R   R   R   R   R   R   R   R   R   R   R   R   R   R   R   R   R   R   R   R   R   R   R   R   R   R   (    (    (    s0   lib/python2.7/site-packages/matplotlib/artist.pyR&   J   s   	$		.																			%													6							
		
									+								%		R   c           B` s   e  Z d  Z d   Z d   Z e j d  Z d   Z d   Z	 d   Z
 d   Z d   Z d	   Z d d
 d  Z d d d  Z d   Z d   Z RS(   u   
    A helper class to inspect an :class:`~matplotlib.artist.Artist`
    and return information about it's settable properties and their
    current values.
    c         C` s   t  | t  sI t j |  rI t |  } t |  rF | d } qF qI n  | |  _ t j |  sp t	 |  } n  | |  _
 |  j   |  _ d S(   u  
        Initialize the artist inspector with an `Artist` or an iterable of
        `Artist`\s.  If an iterable is used, we assume it is a homogeneous
        sequence (all `Artists` are of the same type) and it is your
        responsibility to make sure this is so.
        i    N(   Rk   R&   R   t   iterablet   listR   t   oorigt   inspectt   isclassR   t   ot   get_aliasest   aliasd(   R#   R  (    (    s0   lib/python2.7/site-packages/matplotlib/artist.pyRG   /  s    		c         C` s   g  t  |  j  D]3 } | j d  r t t |  j |   r | ^ q } i  } xf | D]^ } t |  j |  } |  j |  s qV n  | j } | d } d | j | d i   | d <qV W| S(   u   
        Get a dict mapping *fullname* -> *alias* for each *alias* in
        the :class:`~matplotlib.artist.ArtistInspector`.

        e.g., for lines::

          {'markerfacecolor': 'mfc',
           'linewidth'      : 'lw',
          }

        u   set_u   get_i
   i   (   u   set_u   get_N(	   t   dirR  t
   startswithR|   RV   t   is_aliasR   R   t
   setdefault(   R#   t   namet   namest   aliasesR`   R   t   fullname(    (    s0   lib/python2.7/site-packages/matplotlib/artist.pyR  C  s    $	
"u6   \n\s*(?:\.\.\s+)?ACCEPTS:\s*((?:.|\n)*?)(?:$|(?:\n\n))c         C` s   d | } t  |  j |  s8 t d |  j | f   n  t |  j |  } | j } | d k rc d S| j d  rv d S|  j j |  } | d k	 r t	 j
 d d | j d   Sd S(	   u_  
        Get the legal arguments for the setter associated with *attr*.

        This is done by querying the docstring of the function *set_attr*
        for a line that begins with "ACCEPTS" or ".. ACCEPTS":

        e.g., for a line linestyle, return
        "[ ``'-'`` | ``'--'`` | ``'-.'`` | ``':'`` | ``'steps'`` | ``'None'``
        ]"
        u   set_%su   %s has no function %su   unknownu
   alias for u   
 *u    i   N(   RL   R  R>   RV   R   R   R
  t   _get_valid_values_regext   searcht   ret   subt   group(   R#   t   attrR  R`   R   R   (    (    s0   lib/python2.7/site-packages/matplotlib/artist.pyt   get_valid_values`  s    
	c         C` s6  g  } x)t  |  j  D]} | j d  s1 q n  t |  j |  } t |  sU q n  t j rz t t j	 |  d  } n t t j
 |  d  } | d k  s |  j |  r q n  |  j j d |  j j } x> |  j j   D]- } | | j k r | j d | j } Pq q W| j | d | d | f  q W| S(   u   
        Get the attribute strings and a full path to where the setter
        is defined for all setters in an object.
        u   set_i    i   u   .i   (   R	  R  R
  RV   R|   Re   t   PY2R   R  t
   getargspect   getfullargspecR  R   R   t   mroRH   Ro   (   R#   t   settersR  R`   t   nargst   source_classt   cls(    (    s0   lib/python2.7/site-packages/matplotlib/artist.pyt   _get_setters_and_targets}  s&    	#c         C` s#   g  |  j    D] \ } } | ^ q S(   u   
        Get the attribute strings with setters for object.  e.g., for a line,
        return ``['markerfacecolor', 'linewidth', ....]``.
        (   R   (   R#   R   t   target(    (    s0   lib/python2.7/site-packages/matplotlib/artist.pyt   get_setters  s    c         C` s&   | j  } | d k r t S| j d  S(   u^   
        Return *True* if method object *o* is an alias for another
        function.
        u
   alias for N(   R   R   R-   R
  (   R#   R  t   ds(    (    s0   lib/python2.7/site-packages/matplotlib/artist.pyR    s    	c         C` sL   | |  j  k rD | d j g  t |  j  |  D] } d | ^ q,  S| Sd S(   u  
        return 'PROPNAME or alias' if *s* has an alias, else return
        PROPNAME.

        e.g., for the line markerfacecolor property, which has an
        alias, return 'markerfacecolor or mfc' and for the transform
        property, which does not, return 'transform'
        u    u    or %sN(   R  R   R   (   R#   R   RX   (    (    s0   lib/python2.7/site-packages/matplotlib/artist.pyt   aliased_name  s    
)c         C` s\   | |  j  k rE d j g  t |  j  |  D] } d | ^ q)  } n d } d | | | f S(   u.  
        return 'PROPNAME or alias' if *s* has an alias, else return
        PROPNAME formatted for ReST

        e.g., for the line markerfacecolor property, which has an
        alias, return 'markerfacecolor or mfc' and for the transform
        property, which does not, return 'transform'
        u    u    or %su   :meth:`%s <%s>`%s(   R  R   R   (   R#   R   R!  RX   R  (    (    s0   lib/python2.7/site-packages/matplotlib/artist.pyt   aliased_name_rest  s
    
	-i   c   	      C` s   | r d | } n d } | d k	 rE |  j |  } d | | | f S|  j   } | j   g  } xL | D]D \ } } |  j |  } |  j |  } | j d | | | f  qh W| S(   u  
        If *prop* is *None*, return a list of strings of all settable
        properties and their valid values.

        If *prop* is not *None*, it is a valid property name and that
        property will be returned as a string of property : valid
        values.
        u    u    u   %s%s: %sN(   R   R  R   t   sortR$  Ro   (	   R#   R   t   leadingspacet   padt   acceptst   attrst   linesR   R  (    (    s0   lib/python2.7/site-packages/matplotlib/artist.pyt   pprint_setters  s    	
i   c         C` s  | r d | } n d } | d k	 rE |  j |  } d | | | f S|  j   } | j   g  } g  | D] \ } } |  j | |  ^ qh } g  | D] \ } } |  j |  ^ q } t d   | D  }	 t d   | D  }
 | j d  | j | d  | j | d  | d 7} | d	 |	 d d	 |
 } | j d  | j |  | j | d
 j |	 d  d j |
   | j |  | j g  t	 | |  D]0 \ } } | | j |	 d  | j |
  ^ q | j |  | j d  | S(   u/  
        If *prop* is *None*, return a list of strings of all settable
        properties and their valid values.  Format the output for ReST

        If *prop* is not *None*, it is a valid property name and that
        property will be returned as a string of property : valid
        values.
        u    u    u   %s%s: %sc         s` s   |  ] } t  |  Vq d  S(   N(   R   (   R   t   n(    (    s0   lib/python2.7/site-packages/matplotlib/artist.pys	   <genexpr>  s    c         s` s   |  ] } t  |  Vq d  S(   N(   R   (   R   R{   (    (    s0   lib/python2.7/site-packages/matplotlib/artist.pys	   <genexpr>  s    u
   .. table::u      :class: property-tableu      u   =u   Propertyi   u   DescriptionN(
   R   R  R   R&  R%  t   maxRo   t   ljustRu   t   zip(   R#   R   R'  R(  R)  R*  R+  R!  R  t   col0_lent   col1_lent   table_formatstrR-  R{   (    (    s0   lib/python2.7/site-packages/matplotlib/artist.pyt   pprint_setters_rest  s:    	
((
	Dc         C` s   |  j  } g  t |  D]0 } | j d  r t t | |   r | ^ q } | j   t   } xz | D]r } t | |  } |  j |  r qf n  y- t j	    t j
 d  |   } Wd QXWn
 qf qf X| | | d <qf W| S(   uD   
        return a dictionary mapping property name -> value
        u   get_u   ignoreNi   (   R  R	  R
  R|   RV   R&  R   R  R}   t   catch_warningst   simplefilter(   R#   R  R  t   gettersRJ   R`   R$   (    (    s0   lib/python2.7/site-packages/matplotlib/artist.pyR     s"    	0
	c         C` s   g  } x t  t j |  j     D] \ } } t | d d  d	 k ro t |  d k ro t | d   d } n t |  } | j d d  } t |  d k r | d  d } n  |  j |  } | j	 d | | f  q" W| S(
   uJ   
        Return the getters and actual values as list of strings.
        u   shapei   u   ...u   
u    i2   u       %s = %s(    (    (
   R   Re   Rf   R   RV   R   t   strt   replaceR$  Ro   (   R#   R+  R  R$   R   (    (    s0   lib/python2.7/site-packages/matplotlib/artist.pyt   pprint_getters1  s    (*N(   R   R   R   RG   R  R  t   compileR  R  R   R"  R  R$  R%  R   R,  R4  R   R:  (    (    (    s0   lib/python2.7/site-packages/matplotlib/artist.pyR   )  s   							
		1	c         C` sU   | d k r; t |   } | j   } t d j |   d St |  d |  } |   S(   uJ  
    Return the value of object's property.  *property* is an optional string
    for the property you want to return

    Example usage::

        getp(obj)  # get all the object properties
        getp(obj, 'linestyle')  # get the linestyle property

    *obj* is a :class:`Artist` instance, e.g.,
    :class:`~matplotllib.lines.Line2D` or an instance of a
    :class:`~matplotlib.axes.Axes` or :class:`matplotlib.text.Text`.
    If the *property* is 'somename', this function returns

      obj.get_somename()

    :func:`getp` can be used to query all the gettable properties with
    ``getp(obj)``. Many properties have aliases for shorter typing, e.g.
    'lw' is an alias for 'linewidth'.  In the output, aliases and full
    property names will be listed as:

      property or alias = value

    e.g.:

      linewidth or lw = 2
    u   
Nu   get_(   R   R   R:  Rr   R   RV   (   t   objR   t   inspR   R`   (    (    s0   lib/python2.7/site-packages/matplotlib/artist.pyt   getpD  s    c         O` s  t  |  t  r |  g } n t t j |    } | s: d St | d  } i  } d | k rr | j d  | d <n  | r t |  d k  r | r t | j	 d | d  |  n t d j
 | j	    |  d St |  d r t d   n  t   } x: t d t |  d d  D] } | | d | | | <qWg  | D] } | j |  ^ q=}	 |	 j g  | D] } | j |   ^ qe g  t j |	  D] }
 |
 ^ qS(	   u  
    Set a property on an artist object.

    matplotlib supports the use of :func:`setp` ("set property") and
    :func:`getp` to set and get object properties, as well as to do
    introspection on the object.  For example, to set the linestyle of a
    line to be dashed, you can do::

      >>> line, = plot([1,2,3])
      >>> setp(line, linestyle='--')

    If you want to know the valid types of arguments, you can provide
    the name of the property you want to set without a value::

      >>> setp(line, 'linestyle')
          linestyle: [ '-' | '--' | '-.' | ':' | 'steps' | 'None' ]

    If you want to see all the properties that can be set, and their
    possible values, you can do::

      >>> setp(line)
          ... long output listing omitted

    You may specify another output file to `setp` if `sys.stdout` is not
    acceptable for some reason using the `file` keyword-only argument::

      >>> with fopen('output.log') as f:
      >>>     setp(line, file=f)

    :func:`setp` operates on a single instance or a iterable of
    instances. If you are in query mode introspecting the possible
    values, only the first instance in the sequence is used. When
    actually setting values, all the instances will be set.  e.g.,
    suppose you have a list of two lines, the following will make both
    lines thicker and red::

      >>> x = arange(0,1.0,0.01)
      >>> y1 = sin(2*pi*x)
      >>> y2 = sin(4*pi*x)
      >>> lines = plot(x, y1, x, y2)
      >>> setp(lines, linewidth=2, color='r')

    :func:`setp` works with the MATLAB style string/value pairs or
    with python kwargs.  For example, the following are equivalent::

      >>> setp(lines, 'linewidth', 2, 'color', 'r')  # MATLAB style
      >>> setp(lines, linewidth=2, color='r')        # python style
    Ni    u   filei   R   u   
u(   The set args must be string, value pairsi   (   Rk   R&   R  R   t   flattenR   t   popR   Rr   R,  R   R\   R   t   rangeR   Ru   R   (   R<  R   R   t   objsR=  t	   printArgst   funcvalst   iR  R   RX   (    (    s0   lib/python2.7/site-packages/matplotlib/artist.pyt   setpm  s,    2 	#")c         C` sU   t  j d } | r2 d j t |   j d d   Sd j t |   j d d   Sd  S(   Nu   docstring.hardcopyu   
R'  i   i   (   t
   matplotlibR	   R   R   R4  R,  (   R{   t   hardcopy(    (    s0   lib/python2.7/site-packages/matplotlib/artist.pyt   kwdoc  s
    
(+   t
   __future__R    R   R   R   Re   t   collectionsR   R   t	   functoolsR   R  R  R}   t   numpyR   RG  t    R   R   R	   R   R
   t
   transformsR   R   R   R   R   R   R    R%   RE   t   objectR&   R   R   R>  R   RF  RI  t   interpdR   (    (    (    s0   lib/python2.7/site-packages/matplotlib/artist.pyt   <module>   s2   ".		    &	U	