a
    ضa
                    @   sN  d 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mZ ddl
mZ ddlm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 eeZd
d Z dd Z!ej"e#dgdgddgdgdgdgdgdgdgdgdgdgdG dd deZ$G dd dZ%G d d! d!Z&G d"d# d#e$e&Z'ej"j(e'j)j d$ dS )%z)
Classes for including text in a figure.
    N   )_apiartistcbook	docstring)Artist)FontProperties)FancyArrowPatchFancyBboxPatch	Rectangle)TextPath)Affine2DBboxBboxBaseBboxTransformToIdentityTransform	Transformc              
   C   s   zt | d W S  ttfy } zXt| ds6| du rDW Y d}~dS t| dr^W Y d}~dS td| |W Y d}~n
d}~0 0 dS )a*  
    Return *rotation* normalized to an angle between 0 and 360 degrees.

    Parameters
    ----------
    rotation : float or {None, 'horizontal', 'vertical'}
        Rotation angle in degrees. *None* and 'horizontal' equal 0,
        'vertical' equals 90.

    Returns
    -------
    float
    h  Z
horizontalN        Zverticalg     V@zRrotation is {!r}; expected either 'horizontal', 'vertical', numeric value, or None)float
ValueError	TypeErrorr   
_str_equalformat)rotationerr r   _/Users/vegardjervell/Documents/master/model/venv/lib/python3.9/site-packages/matplotlib/text.pyget_rotation   s    r   c                 C   s   g }g }t |  }t | }| |\}}}|D ]\\}	}
}}|
\}}|||f\}}||8 }|| ||  }}|||g |||g q8t|t| }}t	|| t	||  }}t |||f\}}||||fS )z
    Calculate the bounding box of the text.

    The bbox position takes text rotation into account, but the width and
    height are those of the unrotated box (unlike `.Text.get_window_extent`).
    )
npZdeg2radr   r   rotate_get_layout	transformextendminmax)textrendererZprojected_xsZprojected_ysthetatr_partsdtwhxywhZxt1Zyt1Zxt2Zyt2Zxt_boxZyt_boxw_boxh_boxx_boxy_boxr   r   r   _get_textbox4   s     r7   cfamilyfontZfont_propertiesZhamanamesizestretchstylevariantvaweight)color
fontfamilyfontpropertieshorizontalalignmentmultialignmentfontnamefontsizeZfontstretch	fontstyleZfontvariantverticalalignmentZ
fontweightc                       s  e Zd ZdZdZedZdd Zddd fddZ	 fddZ
 fddZdd Zdd Zdd Zdd Zdd Zdd Zd d! Z fd"d#Zdd$d%Zd&d' Zd(d) Zd*d+ Zd,d- Zd.d/ Z fd0d1Zd fd2d3	Z fd4d5Zd6d7 Zd8d9 Zd:d; Zd<d= Z d>d? Z!d@dA Z"e#j$dBdC Z%dDdE Z&dFdG Z'dHdI Z(dJdK Z)dLdM Z*dNdO Z+dPdQ Z,dRdS Z-dTdU Z.dVdW Z/dXdY Z0dZd[ Z1e23d\dd]d^Z4d_d` Z5dadb Z6ddcddZ7dedf Z8dgdh Z9didj Z:dkdl Z;dmdn Z<dodp Z=dqdr Z>dsdt Z?dudv Z@dwdx ZAdydz ZBd{d| ZCd}d~ ZDdd ZEdd ZFdd ZGdd ZHdd ZIdd ZJdd ZKdd ZLdd ZMdd ZNdd ZOdd ZPdd ZQdd ZR  ZSS )TextzAHandle storing and drawing of text in window or data coordinates.   2   c                 C   s   d| j | jt| jf S )NzText(%s, %s, %s))_x_yrepr_textselfr   r   r   __repr__p   s    zText.__repr__r    NbaselineleftFT)
parse_mathc                   s   t    || | _| _d| _| | | |dur8|ntjd  | 	| | 
| | | | | | | | | || _|	| _|| _d| _d| _|
du rd}
|
| _| | | | dS )z
        Create a `.Text` instance at *x*, *y* with string *text*.

        Valid keyword arguments are:

        %(Text:kwdoc)s
        rV   Nz
text.colorg333333?)super__init__rO   rP   rR   set_text	set_colormplrcParamsset_fontproperties
set_usetexset_parse_mathset_wrapset_verticalalignmentset_horizontalalignment_multialignment	_rotation_transform_rotates_text_bbox_patch	_renderer_linespacingset_rotation_modeupdate)rT   r/   r0   r&   rC   rK   rF   rG   rE   r   Zlinespacingrotation_modeusetexwrapZtransform_rotates_textrY   kwargs	__class__r   r   r[   s   s.    








zText.__init__c                    s^   t |t}t }|d|}||ur0| | |d|}t | ||urZ| | d S )NrE   bbox)	r   Znormalize_kwargsrL   objectpopr`   rZ   rm   set_bbox)rT   rq   sentinelrE   rt   rr   r   r   rm      s    
zText.updatec                    s   t   }d |d< |S )Nrj   )rZ   __getstate__)rT   r,   rr   r   r   ry      s    
zText.__getstate__c                 C   s   |  |\}}|dur||fS |  r0| jdu r8di fS t| }|j|j  koZ|jkn  o||j|j	  kox|j
kn  }i }| jr| j|\}}|p|}||d< ||fS )zs
        Return whether the mouse event occurred inside the axis-aligned
        bounding-box of the text.
        NFZ
bbox_patch)_default_containsget_visiblerj   rL   get_window_extentx0r/   x1y0r0   y1ri   contains)rT   Z
mouseeventinsideinfort   ZcattrZpatch_insideZpatch_cattrr   r   r   r      s    
zText.containsc                 C   s   |   \}}|  ||fS )zW
        Get the (possibly unit converted) transformed x, y in display coords.
        )get_unitless_positionget_transformr"   rT   r/   r0   r   r   r   _get_xy_display   s    zText._get_xy_displayc                 C   s   | j d ur| j S | jS d S N)rf   _horizontalalignmentrS   r   r   r   _get_multialignment   s    
zText._get_multialignmentc                 C   sR   |   rDt| j}|  \}}|g}||gg}|  ||dS t| jS dS )z3Return the text angle in degrees between 0 and 360.r   N)get_transform_rotates_textr   rg   r   r   Ztransform_anglesitem)rT   angler/   r0   ZanglesZptsr   r   r   r      s    

zText.get_rotationc                 C   s   | j S )zV
        Return whether rotations of the transform affect the text direction.
        )rh   rS   r   r   r   r      s    zText.get_transform_rotates_textc                 C   s"   t jg d|d || _d| _dS )aW  
        Set text rotation mode.

        Parameters
        ----------
        m : {None, 'default', 'anchor'}
            If ``None`` or ``"default"``, the text will be first rotated, then
            aligned according to their horizontal and vertical alignments.  If
            ``"anchor"``, then alignment occurs before rotation.
        )anchordefaultN)rn   TN)r   check_in_list_rotation_modestale)rT   mr   r   r   rl      s    zText.set_rotation_modec                 C   s   | j S )zReturn the text rotation mode.)r   rS   r   r   r   get_rotation_mode   s    zText.get_rotation_modec                    sj   t  | |j| _|j| _|j| _|j| _|j | _|j| _|j	| _	|j
| _
|j| _|j| _d| _d S )NT)rZ   update_from_colorrf   _verticalalignmentr   _fontpropertiescopy_usetexrg   rh   Z_pickerrk   r   )rT   otherrr   r   r   r     s    zText.update_fromc                 C   sR   |   \}}|p| j}|||  t| j| j| j| j| j| j	| j
| jjt|fS )z
        Return a hashable tuple of properties that lets `_get_layout` know
        whether a previously computed layout can be reused.
        )r   rj   get_texthashr   r   r   rk   rg   r   rh   figuredpiweakrefrefrT   r'   r/   r0   r   r   r   _get_layout_cache_key  s    
zText._get_layout_cache_keyc           -         s4  | j |d}|| jv r | j| S d\}}|  d}g }g }g }g }	|jd| j|  r\dndd\}
}}|| | j }t|D ]\}}| 	|\}}|r|j|| j|d\}}}nd } }}t
||}t
||}|| || || | }|dkr
||  }n|t
||| | j 8 }|| |	| ||8 }q|}t
| d} }d}|	d	 | }|| }t |  }|  }|d
krdd t||	D }nJ|dkrʇ fddt||	|D }n$|dkr fddt||	|D }t||f||f||f||fg}||} | dddf  }| dddf 
 }| dddf  }| dddf 
 }||  || }| j}!| j}"|  }#|#dkr"|!dkr|| d }$n|!dkr|}$n|}$|"dkr|| d }%nD|"dkr|}%n4|"dkr || }%n |"dkr|| |d  }%n|}%n|d \}&}'|d \}(})|!dkrR|&|( d }$n|!dkrb|(}$n|&}$|"dkr~|'|) d }%n@|"dkr|)}%n0|"dkr|)| }%n|"dkr|)|d  }%n|'}%||$|%f\}$}%||$8 }||%8 }t|| |}*|||$|%f }+|*tt|t||g|+jR  |f},|,| j|< |,S )z
        Return the extent (bbox) of the text together with
        multiple-alignment information. Note that it returns an extent
        of a rotated text when necessary.
        )r'   )r   r   
ZlpTeXF)ismathr   rX   c                 S   s   g | ]\}}||fqS r   r   ).0r/   r0   r   r   r   
<listcomp>k      z$Text._get_layout.<locals>.<listcomp>centerc                    s*   g | ]"\}}}| d   |d   |fqS )   r   r   r/   r0   r1   widthr   r   r   m  s   rightc                    s"   g | ]\}}}|  | |fqS r   r   r   r   r   r   r   p  s   Nr   r   r   toprW   center_baselineg       @)r   _cachedr   splitget_text_width_height_descentr   
get_usetexrk   	enumerate_preprocess_mathr%   appendr   
rotate_degr   r   zipr   arrayr"   r$   r   r   r   r   from_boundslistT)-rT   r'   keyZthisxZthisylineswsZhsxsZysr*   Zlp_hZlp_dZmin_dyiline
clean_liner   r1   r2   r,   rW   descentZxminZxmaxZymaxZyminheightMZmalignZoffset_layoutZcorners_horizZcorners_rotatedZhalignZvalignrn   ZoffsetxZoffsetyZxmin1Zymin1Zxmax1Zymax1rt   Zxysretr   r   r   r!   "  s    
































$
zText._get_layoutc                 C   s   |dur|  }|dd}|dd}|du rNd}|du r@d}||   }n|du rZd}t|trxd|vrx|d| 7 }td|t d	|| _nd| _|   dS )
a  
        Draw a bounding box around self.

        Parameters
        ----------
        rectprops : dict with properties for `.patches.FancyBboxPatch`
             The default boxstyle is 'square'. The mutation
             scale of the `.patches.FancyBboxPatch` is set to the fontsize.

        Examples
        --------
        ::

            t.set_bbox(dict(facecolor='red', alpha=0.5))
        NboxstylepadZsquare   g333333?z
,pad=%0.2f)r   r   r   r   )r   r"   )	r   rv   get_size
isinstancestrr
   r   ri   _update_clip_properties)rT   Z	rectpropspropsr   r   r   r   r   rw     s(    
zText.set_bboxc                 C   s   | j S )zf
        Return the bbox Patch, or None if the `.patches.FancyBboxPatch`
        is not made.
        )ri   rS   r   r   r   get_bbox_patch  s    zText.get_bbox_patchc           	      C   s   | j rt| | j}t| | j}|  ||f\}}t| |\}}}}| j 	dd|| | j 
t |  || ||  ||  }| j | dS )z
        Update the location and the size of the bbox.

        This method should be used when the position and size of the bbox needs
        to be updated before actually drawing the bbox.
        r   N)ri   r   convert_xunitsrO   convert_yunitsrP   r   r"   r7   Z
set_boundsset_transformr   r   r   	translatepoints_to_pixelsr   set_mutation_scale)	rT   r'   posxposyr5   r6   r3   r4   Zfontsize_in_pixelr   r   r   update_bbox_position_size  s    zText.update_bbox_position_sizec                 C   s*   t | j| j| jd}| jr&| j| d S )N)Zclip_boxZ	clip_pathclip_on)dictclipboxZ	_clippathZ_cliponri   rm   )rT   Z	clippropsr   r   r   r     s    zText._update_clip_propertiesc                    s   t  | |   d S r   )rZ   set_clip_boxr   )rT   r   rr   r   r   r     s    zText.set_clip_boxc                    s   t  || |   d S r   )rZ   set_clip_pathr   )rT   pathr"   rr   r   r   r     s    zText.set_clip_pathc                    s   t  | |   d S r   )rZ   set_clip_onr   rT   brr   r   r   r     s    zText.set_clip_onc                 C   s   | j S )z'Return whether the text can be wrapped._wraprS   r   r   r   get_wrap  s    zText.get_wrapc                 C   s
   || _ dS )a  
        Set whether the text can be wrapped.

        Parameters
        ----------
        wrap : bool

        Notes
        -----
        Wrapping does not work together with
        ``savefig(..., bbox_inches='tight')`` (which is also used internally
        by ``%matplotlib inline`` in IPython/Jupyter). The 'tight' setting
        rescales the canvas to accommodate all content and happens before
        wrapping.
        Nr   )rT   rp   r   r   r   rc     s    zText.set_wrapc           	      C   s   |   |  \}}|   }|  }| d |  }| ||||}| d| d |||}|dkrr|}n|dkr|}ndt	|| }|S )zk
        Return the maximum line width for wrapping text based on the current
        orientation.
        r      r   rX   r   r   )
r   r"   get_positionZ
get_figurer|   get_horizontalalignmentrl   r   _get_dist_to_boxr$   )	rT   r}   r   
figure_box	alignmentr   rX   r   
line_widthr   r   r   _get_wrap_line_width1  s    
zText._get_wrap_line_widthc                 C   s  |dkrD|d }|t t | }|j| t t d|  }n|dkr|d }|t t | }|t t d|  }n||dkr|d }|j| t t | }|t t d|  }n8|j| t t | }|j| t t d|  }t||S )zr
        Return the distance from the given points to the boundaries of a
        rotated box, in pixels.
        i  Z   r   )mathcosradiansr~   r   r$   )rT   r   r}   r   r   Zquadh1h2r   r   r   r   K  s     zText._get_dist_to_boxc                 C   s$   | j ||  d\}}}t|S )zE
        Return the width of a given text string, in pixels.
        F)rj   r   get_fontpropertiesr   ceil)rT   r&   r1   r2   r,   r   r   r   _get_rendered_text_widthb  s    
zText._get_rendered_text_widthc           	   
   C   s  |   s|  S |  r |  S |  }g }|  d}|D ]}|d}t|dkr>t|dkrv||d qLtdt|d D ]}d	|d| }| 
|}||kr|d	|d|d   ||d d } qLq|t|kr|d	|d|  g } qLqqLq>d	|S )z
        Return a copy of the text string with new lines added so that the text
        is wrapped relative to the parent figure (if `get_wrap` is True).
        r    r   r   r   N)r   r   r   r   r   lenr   rv   rangejoinr   )	rT   r   Zwrapped_linesZunwrapped_linesZunwrapped_lineZ	sub_wordsr   r   Zcurrent_widthr   r   r   _get_wrapped_textl  s2    


zText._get_wrapped_textc                 C   s2  |d ur|| _ |  sd S |  dkr*d S |d|   | j|  d | |\}}}|  }t	| 
| j}t	| | j}|||f\}}t|rt|std W d    d S | \}}	| jr| | | j| | }
|
|   |
|   |
| j | |
 |  }|D ]\}}}}t |dkrR| nd }|| }|| }|! rx|	| }| "|\}}| # rddl$m%} || # |}n|}| & r|j'|
|||| j(||d n|j)|
|||| j(|||d	 q4W d    n1 s0    Y  |
*  |+d d
| _,d S )NrV   r&   )r&   z%posx and posy should be finite valuesr   r   )PathEffectRenderer)mtext)r   r  F)-rj   r{   r   Z
open_groupZget_gidZ_cm_setr   r!   r   r   r   rO   r   rP   r"   r   isfinite_logwarningZget_canvas_width_heightri   r   drawZnew_gcZset_foreground	get_colorZ	set_alphaZ	get_alphaZset_url_urlZ_set_gc_clipr   r   Zflipyr   Zget_path_effectsZmatplotlib.patheffectsr   r   Zdraw_texr   Z	draw_textrestoreZclose_groupr   )rT   r'   rt   r   r   transr   r   ZcanvaswZcanvashgcr   r   r.   r/   r0   r  r   r   r   Ztextrendererr   r   r   r    sf    





*
z	Text.drawc                 C   s   | j S )zReturn the color of the text.)r   rS   r   r   r   r    s    zText.get_colorc                 C   s   | j S )z*Return the `.font_manager.FontProperties`.)r   rS   r   r   r   r     s    zText.get_fontpropertiesc                 C   s
   | j  S )z
        Return the list of font families used for font lookup.

        See Also
        --------
        .font_manager.FontProperties.get_family
        )r   Z
get_familyrS   r   r   r   get_fontfamily  s    zText.get_fontfamilyc                 C   s
   | j  S )z
        Return the font name as a string.

        See Also
        --------
        .font_manager.FontProperties.get_name
        )r   get_namerS   r   r   r   get_fontname  s    zText.get_fontnamec                 C   s
   | j  S )z
        Return the font style as a string.

        See Also
        --------
        .font_manager.FontProperties.get_style
        )r   Z	get_stylerS   r   r   r   get_fontstyle  s    zText.get_fontstylec                 C   s
   | j  S )z
        Return the font size as an integer.

        See Also
        --------
        .font_manager.FontProperties.get_size_in_points
        )r   Zget_size_in_pointsrS   r   r   r   get_fontsize  s    zText.get_fontsizec                 C   s
   | j  S )z
        Return the font variant as a string.

        See Also
        --------
        .font_manager.FontProperties.get_variant
        )r   Zget_variantrS   r   r   r   get_fontvariant  s    zText.get_fontvariantc                 C   s
   | j  S )z
        Return the font weight as a string or a number.

        See Also
        --------
        .font_manager.FontProperties.get_weight
        )r   Z
get_weightrS   r   r   r   get_fontweight  s    zText.get_fontweightc                 C   s
   | j  S )z
        Return the font stretch as a string or a number.

        See Also
        --------
        .font_manager.FontProperties.get_stretch
        )r   get_stretchrS   r   r   r   r  )  s    zText.get_stretchc                 C   s   | j S )zs
        Return the horizontal alignment as a string.  Will be one of
        'left', 'center' or 'right'.
        )r   rS   r   r   r   r   3  s    zText.get_horizontalalignmentc                 C   s(   t | | j}t | | j}||fS )z0Return the (x, y) unitless position of the text.)r   r   rO   r   rP   r   r   r   r   r   :  s    zText.get_unitless_positionc                 C   s   | j | jfS )z'Return the (x, y) position of the text.)rO   rP   rS   r   r   r   r   B  s    zText.get_positionz3.5c                 C   sV   |   \}}|p| j}|||  | j| j| jt| j| j| j	| j
| jjt|| jfS )z
        Return a hashable tuple of properties.

        Not intended to be human readable, but useful for backends who
        want to cache derived information about text (e.g., layouts) and
        need to know if the text has changed.
        )r   rj   r   r   r   r   r   r   rg   r   rh   r   r   r   r   rk   r   r   r   r   get_prop_tupI  s    	
zText.get_prop_tupc                 C   s   | j S )zReturn the text string.)rR   rS   r   r   r   r   ]  s    zText.get_textc                 C   s   | j S )z
        Return the vertical alignment as a string.  Will be one of
        'top', 'center', 'bottom', 'baseline' or 'center_baseline'.
        )r   rS   r   r   r   get_verticalalignmenta  s    zText.get_verticalalignmentc           
      C   s&  |   st S |du r | jj}|  dkrxtj| j|d, |  \}}t	||ddW  d   S 1 sn0    Y  |dur|| _
| j
du r| jj| _
| j
du rtdtj| j|dT | | j
\}}}|  \}}	|  ||	f\}}	|||	}|W  d   S 1 s0    Y  dS )a  
        Return the `.Bbox` bounding the text, in display units.

        In addition to being used internally, this is useful for specifying
        clickable regions in a png file on a web page.

        Parameters
        ----------
        renderer : Renderer, optional
            A renderer is needed to compute the bounding box.  If the artist
            has already been drawn, the renderer is cached; thus, it is only
            necessary to pass this argument when calling `get_window_extent`
            before the first `draw`.  In practice, it is usually easier to
            trigger a draw first (e.g. by saving the figure).

        dpi : float, optional
            The dpi value for computing the bbox, defaults to
            ``self.figure.dpi`` (*not* the renderer dpi); should be set e.g. if
            to match regions with a figure saved with a custom dpi value.
        NrV   )r   r   %Cannot get window extent w/o renderer)r{   r   unitr   r   r   r   Z_setattr_cmr   r   rj   _cachedRendererRuntimeErrorr!   r   r   r"   Z
translated)
rT   r'   r   Ztxtyrt   r   r   r/   r0   r   r   r   r|   h  s(    .


zText.get_window_extentc                 C   sB   | j du r| t||d n| j t|d |   d| _dS )z
        Set the background color of the text by updating the bbox.

        Parameters
        ----------
        color : color

        See Also
        --------
        .set_bbox : To change the position of the bounding box
        N)	facecolorZ	edgecolor)r  T)ri   rw   r   rm   r   r   rT   rC   r   r   r   set_backgroundcolor  s
    
zText.set_backgroundcolorc                 C   sR   t |dstjj|d zt| W n ty@   t|}Y n0 || _d| _	dS )zs
        Set the foreground color of the text

        Parameters
        ----------
        color : color
        auto)rC   TN)
r   r   r^   colorsZ_check_color_liker   r   tupler   r   r  r   r   r   r]     s    
zText.set_colorc                 C   s"   t jg d|d || _d| _dS )z
        Set the horizontal alignment to one of

        Parameters
        ----------
        align : {'center', 'right', 'left'}
        r   r   rX   alignTN)r   r   r   r   rT   r"  r   r   r   re     s    zText.set_horizontalalignmentc                 C   s"   t jg d|d || _d| _dS )al  
        Set the text alignment for multiline texts.

        The layout of the bounding box of all the lines is determined by the
        horizontalalignment and verticalalignment properties. This property
        controls the alignment of the text lines within that box.

        Parameters
        ----------
        align : {'left', 'right', 'center'}
        r   r!  TN)r   r   rf   r   r#  r   r   r   set_multialignment  s    zText.set_multialignmentc                 C   s   || _ d| _dS )z
        Set the line spacing as a multiple of the font size.

        The default line spacing is 1.2.

        Parameters
        ----------
        spacing : float (multiple of font size)
        TN)rk   r   )rT   spacingr   r   r   set_linespacing  s    
zText.set_linespacingc                 C   s   | j | d| _dS )a  
        Set the font family.  May be either a single string, or a list of
        strings in decreasing priority.  Each string may be either a real font
        name or a generic font class name.  If the latter, the specific font
        names will be looked up in the corresponding rcParams.

        If a `Text` instance is constructed with ``fontfamily=None``, then the
        font is set to :rc:`font.family`, and the
        same is done when `set_fontfamily()` is called on an existing
        `Text` instance.

        Parameters
        ----------
        fontname : {FONTNAME, 'serif', 'sans-serif', 'cursive', 'fantasy', 'monospace'}

        See Also
        --------
        .font_manager.FontProperties.set_family
        TN)r   
set_familyr   rT   rH   r   r   r   set_fontfamily  s    zText.set_fontfamilyc                 C   s   | j | d| _dS )z
        Set the font variant.

        Parameters
        ----------
        variant : {'normal', 'small-caps'}

        See Also
        --------
        .font_manager.FontProperties.set_variant
        TN)r   Zset_variantr   )rT   r@   r   r   r   set_fontvariant  s    zText.set_fontvariantc                 C   s   | j | d| _dS )z
        Set the font style.

        Parameters
        ----------
        fontstyle : {'normal', 'italic', 'oblique'}

        See Also
        --------
        .font_manager.FontProperties.set_style
        TN)r   Z	set_styler   )rT   rJ   r   r   r   set_fontstyle  s    zText.set_fontstylec                 C   s   | j | d| _dS )a  
        Set the font size.

        Parameters
        ----------
        fontsize : float or {'xx-small', 'x-small', 'small', 'medium', 'large', 'x-large', 'xx-large'}
            If float, the fontsize in points. The string values denote sizes
            relative to the default font size.

        See Also
        --------
        .font_manager.FontProperties.set_size
        TN)r   Zset_sizer   )rT   rI   r   r   r   set_fontsize  s    zText.set_fontsizec                 C   s
   | j  S )z
        Return the font family name for math text rendered by Matplotlib.

        The default value is :rc:`mathtext.fontset`.

        See Also
        --------
        set_math_fontfamily
        )r   get_math_fontfamilyrS   r   r   r   r-  .  s    
zText.get_math_fontfamilyc                 C   s   | j | dS )a  
        Set the font family for math text rendered by Matplotlib.

        This does only affect Matplotlib's own math renderer. It has no effect
        when rendering with TeX (``usetex=True``).

        Parameters
        ----------
        fontfamily : str
            The name of the font family.

            Available font families are defined in the
            :ref:`matplotlibrc.template file
            <customizing-with-matplotlibrc-files>`.

        See Also
        --------
        get_math_fontfamily
        N)r   set_math_fontfamily)rT   rD   r   r   r   r.  :  s    zText.set_math_fontfamilyc                 C   s   | j | d| _dS )ab  
        Set the font weight.

        Parameters
        ----------
        weight : {a numeric value in range 0-1000, 'ultralight', 'light', 'normal', 'regular', 'book', 'medium', 'roman', 'semibold', 'demibold', 'demi', 'bold', 'heavy', 'extra bold', 'black'}

        See Also
        --------
        .font_manager.FontProperties.set_weight
        TN)r   Z
set_weightr   )rT   rB   r   r   r   set_fontweightP  s    zText.set_fontweightc                 C   s   | j | d| _dS )a  
        Set the font stretch (horizontal condensation or expansion).

        Parameters
        ----------
        stretch : {a numeric value in range 0-1000, 'ultra-condensed', 'extra-condensed', 'condensed', 'semi-condensed', 'normal', 'semi-expanded', 'expanded', 'extra-expanded', 'ultra-expanded'}

        See Also
        --------
        .font_manager.FontProperties.set_stretch
        TN)r   Zset_stretchr   )rT   r>   r   r   r   set_fontstretcha  s    zText.set_fontstretchc                 C   s    |  |d  | |d  dS )z}
        Set the (*x*, *y*) position of the text.

        Parameters
        ----------
        xy : (float, float)
        r   r   N)set_xset_y)rT   xyr   r   r   set_positionr  s    zText.set_positionc                 C   s   || _ d| _dS )zl
        Set the *x* position of the text.

        Parameters
        ----------
        x : float
        TN)rO   r   )rT   r/   r   r   r   r1  }  s    z
Text.set_xc                 C   s   || _ d| _dS )zl
        Set the *y* position of the text.

        Parameters
        ----------
        y : float
        TN)rP   r   )rT   r0   r   r   r   r2    s    z
Text.set_yc                 C   s   || _ d| _dS )a"  
        Set the rotation of the text.

        Parameters
        ----------
        s : float or {'vertical', 'horizontal'}
            The rotation angle in degrees in mathematically positive direction
            (counterclockwise). 'horizontal' equals 0, 'vertical' equals 90.
        TN)rg   r   rT   sr   r   r   set_rotation  s    
zText.set_rotationc                 C   s   || _ d| _dS )z
        Whether rotations of the transform affect the text direction.

        Parameters
        ----------
        t : bool
        TN)rh   r   )rT   r-   r   r   r   set_transform_rotates_text  s    zText.set_transform_rotates_textc                 C   s"   t jg d|d || _d| _dS )z
        Set the vertical alignment.

        Parameters
        ----------
        align : {'center', 'top', 'bottom', 'baseline', 'center_baseline'}
        )r   Zbottomr   rW   r   r!  TN)r   r   r   r   r#  r   r   r   rd     s    zText.set_verticalalignmentc                 C   s*   |du rd}|| j kr&t|| _ d| _dS )a1  
        Set the text string *s*.

        It may contain newlines (``\n``) or math in LaTeX syntax.

        Parameters
        ----------
        s : object
            Any object gets converted to its `str` representation, except for
            ``None`` which is converted to an empty string.
        NrV   T)rR   r   r   r5  r   r   r   r\     s
    

zText.set_textc                 C   sR   |   r|dkrd}|dfS |  s,|dfS t|r>|dfS |dddfS dS )	a  
        Return the string *s* after mathtext preprocessing, and the kind of
        mathtext support needed.

        - If *self* is configured to use TeX, return *s* unchanged except that
          a single space gets escaped, and the flag "TeX".
        - Otherwise, if *s* is mathtext (has an even number of unescaped dollar
          signs) and ``parse_math`` is not set to False, return *s* and the
          flag True.
        - Otherwise, return *s* with dollar signs unescaped, and the flag
          False.
        r   z\ r   FTz\$$N)r   get_parse_mathr   Zis_math_textreplacer5  r   r   r   r     s    
zText._preprocess_mathc                 C   s   t | | _d| _dS )ar  
        Set the font properties that control the text.

        Parameters
        ----------
        fp : `.font_manager.FontProperties` or `str` or `pathlib.Path`
            If a `str`, it is interpreted as a fontconfig pattern parsed by
            `.FontProperties`.  If a `pathlib.Path`, it is interpreted as the
            absolute path to a font file.
        TN)r   Z	_from_anyr   r   r   )rT   fpr   r   r   r`     s    zText.set_fontpropertiesc                 C   s*   |du rt jd | _n
t|| _d| _dS )z
        Parameters
        ----------
        usetex : bool or None
            Whether to render using TeX, ``None`` means to use
            :rc:`text.usetex`.
        Nztext.usetexT)r^   r_   r   boolr   )rT   ro   r   r   r   ra     s    
zText.set_usetexc                 C   s   | j S )z9Return whether this `Text` object uses TeX for rendering.)r   rS   r   r   r   r     s    zText.get_usetexc                 C   s   t || _dS )a0  
        Override switch to disable any mathtext parsing for this `Text`.

        Parameters
        ----------
        parse_math : bool
            If False, this `Text` will never use mathtext.  If True, mathtext
            will be used if there is an even number of unescaped dollar signs.
        N)r=  _parse_math)rT   rY   r   r   r   rb     s    
zText.set_parse_mathc                 C   s   | j S )z>Return whether mathtext parsing is considered for this `Text`.)r>  rS   r   r   r   r:    s    zText.get_parse_mathc                 C   s
   |  |S )a-  
        Alias for `set_family`.

        One-way alias only: the getter differs.

        Parameters
        ----------
        fontname : {FONTNAME, 'serif', 'sans-serif', 'cursive', 'fantasy', 'monospace'}

        See Also
        --------
        .font_manager.FontProperties.set_family

        )r'  r(  r   r   r   set_fontname  s    zText.set_fontname)r   r   rV   NrW   rX   NNNNNNFF)N)N)N)NN)T__name__
__module____qualname____doc__Zzorderr   maxdictr   rU   r[   rm   ry   r   r   r   r   r   rl   r   r   r   r!   rw   r   r   r   r   r   r   r   rc   r   r   r   r   r   allow_rasterizationr  r  r   r  r  r  r  r  r  r  r   r   r   r   
deprecatedr  r   r  r|   r  r]   re   r$  r&  r)  r*  r+  r,  r-  r.  r/  r0  r4  r1  r2  r7  r8  rd   r\   r   r`   ra   r   rb   r:  r?  __classcell__r   r   rr   r   rL   [   s   
            /
 (
3
E







,rL   c                   @   s:   e Zd ZdZdddZdd Zdd Zd	d
 Zdd ZdS )
OffsetFromz4Callable helper class for working with `Annotation`.pointsc                 C   s   || _ || _| | dS )ab  
        Parameters
        ----------
        artist : `.Artist` or `.BboxBase` or `.Transform`
            The object to compute the offset from.

        ref_coord : (float, float)
            If *artist* is an `.Artist` or `.BboxBase`, this values is
            the location to of the offset origin in fractions of the
            *artist* bounding box.

            If *artist* is a transform, the offset origin is the
            transform applied to this value.

        unit : {'points, 'pixels'}, default: 'points'
            The screen units to use (pixels or points) for the offset input.
        N)_artist
_ref_coordset_unit)rT   r   Z	ref_coordr  r   r   r   r[   )  s    zOffsetFrom.__init__c                 C   s   t jddg|d || _dS )z
        Set the unit for input to the transform used by ``__call__``.

        Parameters
        ----------
        unit : {'points', 'pixels'}
        rI  pixels)r  N)r   r   _unit)rT   r  r   r   r   rL  ?  s    zOffsetFrom.set_unitc                 C   s   | j S )z@Return the unit for input to the transform used by ``__call__``.)rN  rS   r   r   r   get_unitJ  s    zOffsetFrom.get_unitc                 C   s"   |   }|dkrdS |dS d S )NrM  g      ?)rO  r   )rT   r'   r  r   r   r   
_get_scaleN  s    zOffsetFrom._get_scalec           	      C   s   t | jtrD| j|}| j\}}|j|j|  }|j|j|  }nft | jt	r| j}| j\}}|j|j|  }|j|j|  }n(t | jt
r| j| j\}}ntd| |}t |||}|S )aL  
        Return the offset transform.

        Parameters
        ----------
        renderer : `RendererBase`
            The renderer to use to compute the offset

        Returns
        -------
        `Transform`
            Maps (x, y) in pixel or point units to screen units
            relative to the given artist.
        zunknown type)r   rJ  r   r|   rK  r}   r   r   r   r   r   r"   r  rP  r   scaler   )	rT   r'   rt   ZxfZyfr/   r0   Zscr)   r   r   r   __call__U  s     


zOffsetFrom.__call__N)rI  )	r@  rA  rB  rC  r[   rL  rO  rP  rR  r   r   r   r   rH  &  s   
rH  c                   @   sX   e Zd ZdddZdd Zdd Zd	d
 Zdd Zdd Zdd Z	dd Z
dddZdS )_AnnotationBasedataNc                 C   s    || _ || _| | d | _d S r   )r3  xycoordsset_annotation_clip
_draggable)rT   r3  rU  annotation_clipr   r   r   r[   z  s    
z_AnnotationBase.__init__c                 C   s`   t |tr|\}}n
|| }}|dkr4t| |}|dkrJt| |}| ||||fS )NrT  )r   r  r   r   r   _get_xy_transformr"   )rT   r'   r/   r0   r6  s1s2r   r   r   _get_xy  s    


z_AnnotationBase._get_xyc                 C   sh  t |trD|\}}ddlm} | ||}| ||}|||}|S t|r~||}t |trft|S t |trt|S t	dnRt |t
r||}	t|	S t |trt|S t |tr|S t |tst	d| |dkr| jjS |dkrddlm}
 |
 }|| jj }|S | }t|dkr0td	| d
\}}|\}}|dkrT| jj}n&|dkrh| jj}n|dkrz| jj}|d ur|j}n|dkr| |}|d urX|\}}|dkr| j d }t |}nt|dkrt }nb|dkr|  }|| j  d }t |}n0|dkr@|j\}}t ||}ntd	| |||S td	| d S )Nr   )blended_transform_factoryzunknown return type ...zunknown coordinate type : %srT  Zpolar)	PolarAxesr   z!%s is not a recognized coordinate)NNr   Z	subfigureaxesoffsetrI  g      R@rM  rI   fraction) r   r  Zmatplotlib.transformsr]  rY  callabler   r   r   r  r   r|   r   r_  Z	transDataZmatplotlib.projectionsr^  ZPolarTransformr   r   r   r   Zfigbboxrt   Zp0_get_ref_xyZget_dpir   rQ  r   r=   r   )rT   r'   r6  rZ  r[  r]  Ztr1Ztr2r)   rt   r^  r	  Zs_Zbbox0Zxy0Z	bbox_namer  Zref_xZref_yZdpprI   r1   r2   r   r   r   rY    s|    
























z!_AnnotationBase._get_xy_transformc                 C   s   | j |g| j| jR  S )z{
        Return x, y (in display coordinates) that is to be used for a reference
        of any offset coordinate.
        )r\  r3  rU  rT   r'   r   r   r   rc    s    z_AnnotationBase._get_ref_xyc                 C   s
   || _ dS )a  
        Set the annotation's clipping behavior.

        Parameters
        ----------
        b : bool or None
            - True: the annotation will only be drawn when ``self.xy`` is
              inside the axes.
            - False: the annotation will always be drawn regardless of its
              position.
            - None: the ``self.xy`` will be checked only if *xycoords* is
              "data".
        NZ_annotation_clipr   r   r   r   rV    s    z#_AnnotationBase.set_annotation_clipc                 C   s   | j S )z
        Return the annotation's clipping behavior.

        See `set_annotation_clip` for the meaning of return values.
        re  rS   r   r   r   get_annotation_clip  s    z#_AnnotationBase.get_annotation_clipc                 C   s   | j \}}| |||| jS )z1Return the pixel position of the annotated point.)r3  r\  rU  r   r   r   r   _get_position_xy  s    
z _AnnotationBase._get_position_xyc                 C   s8   |   }|s|du r4| jdkr4| |}| j|S dS )z;Check whether the annotation at *xy_pixel* should be drawn.NrT  T)rf  rU  rg  r_  Zcontains_point)rT   r'   r   Zxy_pixelr   r   r   	_check_xy  s
    
z_AnnotationBase._check_xyFc                 C   s`   ddl m} | jdu}|du r$| }|r@| jdu rZ|| || _n| jdurT| j  d| _| jS )a  
        Set whether the annotation is draggable with the mouse.

        Parameters
        ----------
        state : bool or None
            - True or False: set the draggability.
            - None: toggle the draggability.

        Returns
        -------
        DraggableAnnotation or None
            If the annotation is draggable, the corresponding
            `.DraggableAnnotation` helper is returned.
        r   )DraggableAnnotationN)Zmatplotlib.offsetboxri  rW  Z
disconnect)rT   stateZuse_blitri  Zis_draggabler   r   r   	draggable  s    



z_AnnotationBase.draggable)rT  N)NF)r@  rA  rB  r[   r\  rY  rc  rV  rf  rg  rh  rk  r   r   r   r   rS  y  s     
T	rS  c                       s   e Zd ZdZdd Zd ddZdd	 Zed
d Zej	dd Zedd Z
e
j	dd Z
dd Zdd ZeeeddZdd Zdd Zejdd Zd!ddZ fddZ  ZS )"
Annotationa`  
    An `.Annotation` is a `.Text` that can refer to a specific position *xy*.
    Optionally an arrow pointing from the text to *xy* can be drawn.

    Attributes
    ----------
    xy
        The annotated position.
    xycoords
        The coordinate system for *xy*.
    arrow_patch
        A `.FancyArrowPatch` to point from *xytext* to *xy*.
    c                 C   s   d| j d | j d | jf S )NzAnnotation(%g, %g, %r)r   r   )r3  rR   rS   r   r   r   __str__L  s    zAnnotation.__str__NrT  c                 K   s   t j| |||d |du r4|dur4||kr4td |du rB| j}|| _|du rV| j}|\}	}
|| _|dur| }d|v r|	dd| _
ndD ]}|	|d qtd
i || _nd| _tj| |	|
|fi | dS )a  
        Annotate the point *xy* with text *text*.

        In the simplest form, the text is placed at *xy*.

        Optionally, the text can be displayed in another position *xytext*.
        An arrow pointing from the text to the annotated point *xy* can then
        be added by defining *arrowprops*.

        Parameters
        ----------
        text : str
            The text of the annotation.

        xy : (float, float)
            The point *(x, y)* to annotate. The coordinate system is determined
            by *xycoords*.

        xytext : (float, float), default: *xy*
            The position *(x, y)* to place the text at. The coordinate system
            is determined by *textcoords*.

        xycoords : str or `.Artist` or `.Transform` or callable or (float, float), default: 'data'

            The coordinate system that *xy* is given in. The following types
            of values are supported:

            - One of the following strings:

              ==================== ============================================
              Value                Description
              ==================== ============================================
              'figure points'      Points from the lower left of the figure
              'figure pixels'      Pixels from the lower left of the figure
              'figure fraction'    Fraction of figure from lower left
              'subfigure points'   Points from the lower left of the subfigure
              'subfigure pixels'   Pixels from the lower left of the subfigure
              'subfigure fraction' Fraction of subfigure from lower left
              'axes points'        Points from lower left corner of axes
              'axes pixels'        Pixels from lower left corner of axes
              'axes fraction'      Fraction of axes from lower left
              'data'               Use the coordinate system of the object
                                   being annotated (default)
              'polar'              *(theta, r)* if not native 'data'
                                   coordinates
              ==================== ============================================

              Note that 'subfigure pixels' and 'figure pixels' are the same
              for the parent figure, so users who want code that is usable in
              a subfigure can use 'subfigure pixels'.

            - An `.Artist`: *xy* is interpreted as a fraction of the artist's
              `~matplotlib.transforms.Bbox`. E.g. *(0, 0)* would be the lower
              left corner of the bounding box and *(0.5, 1)* would be the
              center top of the bounding box.

            - A `.Transform` to transform *xy* to screen coordinates.

            - A function with one of the following signatures::

                def transform(renderer) -> Bbox
                def transform(renderer) -> Transform

              where *renderer* is a `.RendererBase` subclass.

              The result of the function is interpreted like the `.Artist` and
              `.Transform` cases above.

            - A tuple *(xcoords, ycoords)* specifying separate coordinate
              systems for *x* and *y*. *xcoords* and *ycoords* must each be
              of one of the above described types.

            See :ref:`plotting-guide-annotation` for more details.

        textcoords : str or `.Artist` or `.Transform` or callable or (float, float), default: value of *xycoords*
            The coordinate system that *xytext* is given in.

            All *xycoords* values are valid as well as the following
            strings:

            =================   =========================================
            Value               Description
            =================   =========================================
            'offset points'     Offset (in points) from the *xy* value
            'offset pixels'     Offset (in pixels) from the *xy* value
            =================   =========================================

        arrowprops : dict, optional
            The properties used to draw a `.FancyArrowPatch` arrow between the
            positions *xy* and *xytext*.  Defaults to None, i.e. no arrow is
            drawn.

            For historical reasons there are two different ways to specify
            arrows, "simple" and "fancy":

            **Simple arrow:**

            If *arrowprops* does not contain the key 'arrowstyle' the
            allowed keys are:

            ==========   ======================================================
            Key          Description
            ==========   ======================================================
            width        The width of the arrow in points
            headwidth    The width of the base of the arrow head in points
            headlength   The length of the arrow head in points
            shrink       Fraction of total length to shrink from both ends
            ?            Any key to :class:`matplotlib.patches.FancyArrowPatch`
            ==========   ======================================================

            The arrow is attached to the edge of the text box, the exact
            position (corners or centers) depending on where it's pointing to.

            **Fancy arrow:**

            This is used if 'arrowstyle' is provided in the *arrowprops*.

            Valid keys are the following `~matplotlib.patches.FancyArrowPatch`
            parameters:

            ===============  ==================================================
            Key              Description
            ===============  ==================================================
            arrowstyle       the arrow style
            connectionstyle  the connection style
            relpos           see below; default is (0.5, 0.5)
            patchA           default is bounding box of the text
            patchB           default is None
            shrinkA          default is 2 points
            shrinkB          default is 2 points
            mutation_scale   default is text size (in points)
            mutation_aspect  default is 1.
            ?                any key for :class:`matplotlib.patches.PathPatch`
            ===============  ==================================================

            The exact starting point position of the arrow is defined by
            *relpos*. It's a tuple of relative coordinates of the text box,
            where (0, 0) is the lower left corner and (1, 1) is the upper
            right corner. Values <0 and >1 are supported and specify points
            outside the text box. By default (0.5, 0.5) the starting point is
            centered in the text box.

        annotation_clip : bool or None, default: None
            Whether to draw the annotation when the annotation point *xy* is
            outside the axes area.

            - If *True*, the annotation will only be drawn when *xy* is
              within the axes.
            - If *False*, the annotation will always be drawn.
            - If *None*, the annotation will only be drawn when *xy* is
              within the axes and *xycoords* is 'data'.

        **kwargs
            Additional kwargs are passed to `~matplotlib.text.Text`.

        Returns
        -------
        `.Annotation`

        See Also
        --------
        :ref:`plotting-guide-annotation`

        )rU  rX  NzgYou have used the `textcoords` kwarg, but not the `xytext` kwarg.  This can lead to surprising results.
arrowstyleZrelpos)      ?ro  )r   	headwidth
headlengthshrinkfracr   r   r   )r   rt  )rS  r[   r   warn_externalrU  _textcoordsr3  
arrowpropsr   rv   _arrow_relposr	   arrow_patchrL   )rT   r&   r3  xytextrU  Z
textcoordsrw  rX  rq   r/   r0   r   r   r   r   r[   O  s8     .
zAnnotation.__init__c                 C   sX   |  |\}}|d ur||fS t| |\}}| jd urP| j|\}}|pN|}||fS r   )rz   rL   r   ry  )rT   eventr   r   r   ZtinfoZin_patchr*   r   r   r   r   #  s    
zAnnotation.containsc                 C   s   | j S r   )	_xycoordsrS   r   r   r   rU  -  s    zAnnotation.xycoordsc                 C   s:   dd }t |tr tt||s(||r0td|| _d S )Nc                 S   s   t | to| dS )Nr`  )r   r   
startswith)r6  r   r   r   	is_offset3  s    z&Annotation.xycoords.<locals>.is_offsetz'xycoords cannot be an offset coordinate)r   r  anymapr   r|  )rT   rU  r~  r   r   r   rU  1  s    c                 C   s   |   S )zQ
        The text position.

        See also *xytext* in `.Annotation`.
        )r   rS   r   r   r   xyann;  s    zAnnotation.xyannc                 C   s   |  | d S r   )r4  )rT   rz  r   r   r   r  D  s    c                 C   s   | j S )z}
        Return the coordinate system to use for `.Annotation.xyann`.

        See also *xycoords* in `.Annotation`.
        rv  rS   r   r   r   get_anncoordsH  s    zAnnotation.get_anncoordsc                 C   s
   || _ dS )zz
        Set the coordinate system to use for `.Annotation.xyann`.

        See also *xycoords* in `.Annotation`.
        Nr  )rT   Zcoordsr   r   r   set_anncoordsP  s    zAnnotation.set_anncoordsz>
        The coordinate system to use for `.Annotation.xyann`.)docc                 C   s&   | j d ur| j | t| | d S r   )ry  
set_figurer   )rT   Zfigr   r   r   r  [  s    
zAnnotation.set_figurec                    s  |  |\ | | || j | jdu r0dS t| |}| j }|d| 	 }| j
| d|vr|dd}|dd}|dd	}|d
d}|durtd |dd	}	t|	| || || d}
| j
jdi |
 |jdf|j|j d df|jdfg}|jdf|j|j d df|jdfg}t| fddd\}}t|fddd\}}||f| _t| |  }|| |d }| | j
_| j
_| j\}}|j|j|  }|j|j|  }| j
||f f d|v r | j
|d n| jr| j
| j nl|   dkr6| j
d dS |d}t!|j|d  |j|d  f|j| |j| t" dd}| j
| dS )zX
        Update the pixel positions of the annotation text and the arrow patch.
        NZmutation_scalern  rr  r   r   r   rp     rs  zh'frac' option in 'arrowprops' is no longer supported; use 'headlength' to set the head length in points.rq  )Zhead_lengthZ
head_widthZ
tail_widthsimpler   r   ro  r   c                    s   t | d   S Nr   absv)r~   r   r   <lambda>  r   z-Annotation.update_positions.<locals>.<lambda>)r   c                    s   t | d   S r  r  r  )r   r   r   r    r   ZpatchArV   F)r3  r   r   r"   r   )r  )#rg  r   rY  	anncoordsrw  rL   r|   r   rv   r   ry  r   r   ru  r   Zset_arrowstyler}   r~   r   r   r$   rx  r   hypotr   ZshrinkAZshrinkBr   r   Zset_positionsZ
set_patchAri   r   r   r   )rT   r'   rt   r,   msrr  r   rp  rs  rq  ZstylekwZxposZyposr/   Zrelposxr0   ZrelposyrZ
shrink_ptsr}   r   r   r   )r~   r   r   update_positionsa  s`    


&&



zAnnotation.update_positionsc                 C   s~   |d ur|| _ |  r | |s$d S | | | | | jd urn| jjd u rb| jd urb| j| j_| j| t| | d S r   )	rj   r{   rh  r  r   ry  r   r  rL   rd  r   r   r   r    s    



zAnnotation.drawc                 C   s   |   r| |st S |d ur(|| _| jd u r<| jj| _| jd u rNtd| | j t	
| }|g}| jd ur|| j
  t|S )Nr  )r{   rh  r   r  rj   r   r  r  r  rL   r|   ry  r   union)rT   r'   Z	text_bboxZbboxesr   r   r   r|     s    




zAnnotation.get_window_extentc                    s   |  |st S t |S r   )rh  r   nullrZ   get_tightbboxrd  rr   r   r   r    s    
zAnnotation.get_tightbbox)NrT  NNN)N)r@  rA  rB  rC  rm  r[   r   propertyrU  setterr  r  r  r  r  r  r   rE  r  r|   r  rG  r   r   rr   r   rl  =  s6        
 U


	

K

rl  )rl  )*rC  loggingr   r   Znumpyr   Z
matplotlibr^   rV   r   r   r   r   r   Zfont_managerr   Zpatchesr	   r
   r   textpathr   Z
transformsr   r   r   r   r   r   	getLoggerr@  r  r   r7   ZinterpdZ_define_aliasesrL   rH  rS  rl  rm   r[   r   r   r   r   <module>   s^    
'         ES E   #