KGRKJGETMRETU895U-589TY5MIGM5JGB5SDFESFREWTGR54TY
Server : Apache
System : Linux server112.speedpacket.com 3.10.0-962.3.2.lve1.5.36.el7.x86_64 #1 SMP Mon May 18 02:16:06 EDT 2020 x86_64
User : equistyl ( 1341)
PHP Version : 8.1.30
Disable Function : NONE
Directory :  /lib64/python2.7/site-packages/matplotlib/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : //lib64/python2.7/site-packages/matplotlib/offsetbox.pyc
�
r`]c@s�dZddlmZddljZddljZddl	j
ZddlZ
ddlmZmZmZmZmZddlmZddlmZmZddlmZddlmZddljZdd	lmZdd
lmZ e!Z"d�Zdd
�Z#dd�Z$dej%fd��YZ&de&fd��YZ'de'fd��YZ(de'fd��YZ)de&fd��YZ*de&fd��YZ+de&fd��YZ,de&fd��YZ-d e&fd!��YZ.d"e.fd#��YZ/d$e&fd%��YZ0dd&l	m1Z1d'ej%e1fd(��YZ2d)e3fd*��YZ4d+e4fd,��YZ5d-e4fd.��YZ6e7d/kr�ddl8j9Z:e:j;d0�Z<e<j=�e:j>d1�Z?e@�ZAe
jBd2�jCd3d3�d4ZDe0eDd5d6d7dd8deA�ZFe?jGeF�eFjHdM�e0eDd5d6d7dd8deA�ZIe2eIdNd;dOd=d>d?d@dAeJdBdCdDe@dEdFdGdH�dIddJe@dKdL��ZKe?jGeK�e:jL�e:jM�ndS(Ps�
The OffsetBox is a simple container artist. The child artist are meant
to be drawn at a relative position to its parent.  The [VH]Packer,
DrawingArea and TextArea are derived from the OffsetBox.

The [VH]Packer automatically adjust the relative postisions of their
children, which should be instances of the OffsetBox. This is used to
align similar artists together, e.g., in legend.

The DrawingArea can contain any Artist as a child. The
DrawingArea has a fixed width and height. The position of children
relative to the parent is fixed.  The TextArea is contains a single
Text instance. The width and height of the TextArea instance is the
width and height of the its child text.
i����(tprint_functionN(tBboxtBboxBasetTransformedBboxtIdentityTransformtBboxTransformFrom(tFontProperties(tFancyBboxPatchtFancyArrowPatch(trcParams(t	docstring(t	BboxImage(tbbox_artistcOstrt||�ndS(N(tDEBUGtmbbox_artist(targstkwargs((s:/usr/lib64/python2.7/site-packages/matplotlib/offsetbox.pyR)stfixedcCs�t|�\}}|dkrtjjdgg|D]}||^q4�}|d }|dkru|d|}n||fS|dkr�|t|�t|�d}tjjdgg|D]}||^q��}|d }||fS|dkr�t|�}	|dkr(|	|t|�}nt|�t|�|	}tj	gt
t|��D]}
|	||
^q[�}||fStd|f��dS(	s�
    Geiven a list of (width, xdescent) of each boxes, calculate the
    total width and the x-offset positions of each items according to
    *mode*. xdescent is analagous to the usual descent, but along the
    x-direction. xdescent values are currently ignored.

    *wd_list* : list of (width, xdescent) of boxes to be packed.
    *sep* : spacing between boxes
    *total* : Intended total length. None if not used.
    *mode* : packing mode. 'fixed', 'expand', or 'equal'.
    Rii����texpandg�?tequalsUnknown mode : %sN(tziptnptaddt
accumulatetNonetsumtlentmaxtfloattarraytranget
ValueError(twd_listttotaltseptmodetw_listtd_listtwtoffsets_toffsetstmaxhti((s:/usr/lib64/python2.7/site-packages/matplotlib/offsetbox.pyt_get_packed_offsets2s(
0

0

6
tbaselinecCs�|d
kr4tg|D]\}}|^q�}n|dkr�tg|D]\}}||^qJ�}tg|D]\}}|^qs�}||}g|D]\}}d^q�}n�|dkr�d}g|D]\}}|^q�}n�|dkr*d}g|D]\}}|||^q}nS|dkrjd}g|D]\}}||d|^qC}ntd	|f��|||fS(
s)
    Given a list of (height, descent) of each boxes, align the boxes
    with *align* and calculate the y-offsets of each boxes.
    total width and the offset positions of each items according to
    *mode*. xdescent is analogous to the usual descent, but along the
    x-direction. xdescent values are currently ignored.

    *hd_list* : list of (width, xdescent) of boxes to be aligned.
    *sep* : spacing between boxes
    *height* : Intended total length. None if not used.
    *align* : align mode. 'baseline', 'top', 'bottom', or 'center'.
    R,gtleftttoptrighttbottomtcenterg�?sUnknown Align mode : %sN(R-stop(R/R0(RRR(thd_listtheighttalignthtdtheight_descenttdescentR(((s:/usr/lib64/python2.7/site-packages/matplotlib/offsetbox.pyt_get_aligned_offsetsas$()%
""*.t	OffsetBoxcBs�eZdZd�Zd�Zd�Zd�Zd�Zd�Zd�Z	d�Z
d	�Zd
�Zd�Z
d�Zd
�Zd�Zd�ZRS(s�
    The OffsetBox is a simple container artist. The child artist are meant
    to be drawn at a relative position to its parent.
    cOs/tt|�j||�g|_d|_dS(Ni(ii(tsuperR:t__init__t	_childrent_offset(tselfRR((s:/usr/lib64/python2.7/site-packages/matplotlib/offsetbox.pyR<�s	cCs^tjj|�}ddlm}ddl}|d}|j|�rZ||�|d<n|S(Ni����(t_InstanceMethodPicklerR>(tmartisttArtistt__getstate__tcbookR@tinspecttismethod(R?tstateR@REtoffset((s:/usr/lib64/python2.7/site-packages/matplotlib/offsetbox.pyRC�s
cCsD||_ddlm}t|j|�r@|jj�|_ndS(Ni����(R@(t__dict__RDR@t
isinstanceR>tget_instancemethod(R?RGR@((s:/usr/lib64/python2.7/site-packages/matplotlib/offsetbox.pyt__setstate__�s	cCs;tjj||�x!|j�D]}|j|�q WdS(s^
        Set the figure

        accepts a class:`~matplotlib.figure.Figure` instance
        N(RARBt
set_figuretget_children(R?tfigtc((s:/usr/lib64/python2.7/site-packages/matplotlib/offsetbox.pyRM�scCsFx9|j�D]+}|j|�\}}|r
||fSq
WtifS(N(RNtcontainstFalse(R?t
mouseeventRPtatb((s:/usr/lib64/python2.7/site-packages/matplotlib/offsetbox.pyRQ�s
cCs
||_dS(sT
        Set the offset

        accepts x, y, tuple, or a callable object.
        N(R>(R?txy((s:/usr/lib64/python2.7/site-packages/matplotlib/offsetbox.pyt
set_offset�scCs3t|j�r(|j|||||�S|jSdS(sC
        Get the offset

        accepts extent of the box
        N(tcallableR>(R?twidthR3txdescenttydescenttrenderer((s:/usr/lib64/python2.7/site-packages/matplotlib/offsetbox.pyt
get_offset�scCs
||_dS(s6
        Set the width

        accepts float
        N(RY(R?RY((s:/usr/lib64/python2.7/site-packages/matplotlib/offsetbox.pyt	set_width�scCs
||_dS(s7
        Set the height

        accepts float
        N(R3(R?R3((s:/usr/lib64/python2.7/site-packages/matplotlib/offsetbox.pyt
set_height�scCs&g|jD]}|j�r
|^q
S(s?
        Return a list of visible artists it contains.
        (R=tget_visible(R?RP((s:/usr/lib64/python2.7/site-packages/matplotlib/offsetbox.pytget_visible_children�scCs|jS(s7
        Return a list of artists it contains.
        (R=(R?((s:/usr/lib64/python2.7/site-packages/matplotlib/offsetbox.pyRN�scCstd��dS(Nt(t	Exception(R?R\((s:/usr/lib64/python2.7/site-packages/matplotlib/offsetbox.pytget_extent_offsets�scCs.|j|�\}}}}}||||fS(s@
        Return with, height, xdescent, ydescent of box
        (Rd(R?R\R&R5txdtydR(((s:/usr/lib64/python2.7/site-packages/matplotlib/offsetbox.pyt
get_extent�sc	Cs`|j|�\}}}}}|j|||||�\}}tjj||||||�S(s8
        get the bounding box in display space.
        (RdR]tmtransformsRtfrom_bounds(	R?R\R&R5ReRfR(tpxtpy((s:/usr/lib64/python2.7/site-packages/matplotlib/offsetbox.pytget_window_extent�s!c	Cs�|j|�\}}}}}|j|||||�\}}xQt|j�|�D]:\}	\}
}|	j||
||f�|	j|�qUWt||dtdtdd��dS(sm
        Update the location of children if necessary and draw them
        to the given *renderer*.
        tfilltpropstpadgN(	RdR]RRaRWtdrawRRRtdict(R?R\RYR3RZR[R(RjRkRPtoxtoy((s:/usr/lib64/python2.7/site-packages/matplotlib/offsetbox.pyRp�s!((t__name__t
__module__t__doc__R<RCRLRMRQRWR]R^R_RaRNRdRgRlRp(((s:/usr/lib64/python2.7/site-packages/matplotlib/offsetbox.pyR:�s 				
										t
PackerBasecBs&eZdddddddd�ZRS(cCsVtt|�j�||_||_||_||_||_||_||_	dS(s�
        *pad* : boundary pad
        *sep* : spacing between items
        *width*, *height* : width and height of the container box.
           calculated if None.
        *align* : alignment of boxes. Can be one of 'top', 'bottom',
           'left', 'right', 'center' and 'baseline'
        *mode* : packing mode

        .. note::
          *pad* and *sep* need to given in points and will be
          scale with the renderer dpi, while *width* and *height*
          need to be in pixels.
        N(
R;RwR<R3RYR"RoR#R4R=(R?RoR"RYR3R4R#tchildren((s:/usr/lib64/python2.7/site-packages/matplotlib/offsetbox.pyR<s						N(RtRuRR<(((s:/usr/lib64/python2.7/site-packages/matplotlib/offsetbox.pyRwstVPackercBs5eZdZdddddddd�Zd�ZRS(s�
    The VPacker has its children packed vertically. It automatically
    adjust the relative positions of children in the drawing time.
    R,RcCs,tt|�j|||||||�dS(s�
        *pad* : boundary pad
        *sep* : spacing between items
        *width*, *height* : width and height of the container box.
           calculated if None.
        *align* : alignment of boxes
        *mode* : packing mode

        .. note::
          *pad* and *sep* need to given in points and will be
          scale with the renderer dpi, while *width* and *height*
          need to be in pixels.
        N(R;RyR<(R?RoR"RYR3R4R#Rx((s:/usr/lib64/python2.7/site-packages/matplotlib/offsetbox.pyR<*scCs�|jd�}|j|}|j|}|jdk	r�xH|j�D]7}t|t�rE|jdkrE|j	|j�qEqEWng|j�D]}|j
|�^q�}g|D](\}}}	}
|||	||
f^q�}g|D]\}}}	}
||	f^q�}t||j|j�\}}
}g|D]\}}}	}
||
f^q3}t
||j||j�\}}|g|D]\}}}	}
|
^q�}||d}||}||}|d||d||
|||t||�fS(sN
        update offset of childrens and return the extents of the box
        g�?RiiN(tpoints_to_pixelsRoR"RYRRaRJRwR#R^RgR9R4R+R3R(R?R\tdpicorRoR"RPtwhd_listR&R5ReRfR RYRZtxoffsetst	pack_listR3t	yoffsets_tyoffsetsR[((s:/usr/lib64/python2.7/site-packages/matplotlib/offsetbox.pyRd@s.

(5++)

N(RtRuRvRR<Rd(((s:/usr/lib64/python2.7/site-packages/matplotlib/offsetbox.pyRy%s
tHPackercBs5eZdZdddddddd�Zd�ZRS(s�
    The HPacker has its children packed horizontally. It automatically
    adjusts the relative positions of children at draw time.
    R,RcCs,tt|�j|||||||�dS(s�
        *pad* : boundary pad
        *sep* : spacing between items
        *width*, *height* : width and height of the container box.
           calculated if None.
        *align* : alignment of boxes
        *mode* : packing mode

        .. note::
          *pad* and *sep* need to given in points and will be
          scale with the renderer dpi, while *width* and *height*
          need to be in pixels.
        N(R;R�R<(R?RoR"RYR3R4R#Rx((s:/usr/lib64/python2.7/site-packages/matplotlib/offsetbox.pyR<mscCs|jd�}|j|}|j|}g|j�D]}|j|�^q6}|srd|d|||gfS|jdkr�tg|D]\}}}	}
||
^q��}tg|D]\}}}	}
|
^q��}||}
n|jd|}
g|D]\}}}	}
||
f^q}t||j|j	�\}
}}g|D]\}}}	}
||	f^qL}t
||j||j�\}}|g|D]\}}}	}
|	^q�}|dd}||}|d||
d|||||t
||�fS(sM
        update offset of children and return the extents of the box
        g�?iiN(RzRoR"RaRgR3RRR9R4R+RYR#R(R?R\R{RoR"RPR|R&R5ReRfR7R[R3R2R�R~RYt	xoffsets_R}RZ((s:/usr/lib64/python2.7/site-packages/matplotlib/offsetbox.pyRd�s0

(/+
++)
N(RtRuRvRR<Rd(((s:/usr/lib64/python2.7/site-packages/matplotlib/offsetbox.pyR�hs
t	PaddedBoxcBsAeZdedd�Zd�Zd�Zdd�Zd�ZRS(cCs�tt|�j�||_|g|_tdddddddddd	d
ddt�|_|jjd
dd�|dk	r�|jj
|�n||_dS(s�
        *pad* : boundary pad

        .. note::
          *pad* need to given in points and will be
          scale with the renderer dpi, while *width* and *height*
          need to be in pixels.
        RVgRYg�?R3t	facecolorR&t	edgecolortktmutation_scaleitsnaptsquareRoiN(gg(R;R�R<RoR=RtTruetpatchtset_boxstyleRtupdatet
_drawFrame(R?tchildRot
draw_frametpatch_attrs((s:/usr/lib64/python2.7/site-packages/matplotlib/offsetbox.pyR<�s
	cCsl|jd�}|j|}|jdj|�\}}}}|d||d|||||dgfS(sN
        update offset of childrens and return the extents of the box
        g�?ii(ii(RzRoR=Rg(R?R\R{RoR&R5ReRf((s:/usr/lib64/python2.7/site-packages/matplotlib/offsetbox.pyRd�s
"cCs�|j|�\}}}}}|j|||||�\}}xDt|j�|�D]-\}	\}
}|	j||
||f�qUW|j|�x!|j�D]}	|	j|�q�WdS(sm
        Update the location of children if necessary and draw them
        to the given *renderer*.
        N(RdR]RRaRWR�Rp(R?R\RYR3RZR[R(RjRkRPRrRs((s:/usr/lib64/python2.7/site-packages/matplotlib/offsetbox.pyRp�s!(
cCsB|jj|j|j|j|j�|r>|jj|�ndS(N(R�t
set_boundstx0ty0RYR3tset_mutation_scale(R?tbboxtfontsize((s:/usr/lib64/python2.7/site-packages/matplotlib/offsetbox.pytupdate_frame�scCs<|j|�}|j|�|jr8|jj|�ndS(N(RlR�R�R�Rp(R?R\R�((s:/usr/lib64/python2.7/site-packages/matplotlib/offsetbox.pyR��s
	N(	RtRuRRRR<RdRpR�R�(((s:/usr/lib64/python2.7/site-packages/matplotlib/offsetbox.pyR��s
		tDrawingAreacBsheZdZdded�Zd�Zd�Zd�Zd�Zd�Z	d�Z
d	�Zd
�ZRS(s�
    The DrawingArea can contain any Artist as a child. The DrawingArea
    has a fixed width and height. The position of children relative to
    the parent is fixed.
    gcCsytt|�j�||_||_||_||_tj�|_	|j	j
�|j	jdd�tj�|_dS(s�
        *width*, *height* : width and height of the container box.
        *xdescent*, *ydescent* : descent of the box in x- and y-direction.
        iN(
R;R�R<RYR3RZR[RhtAffine2Dtoffset_transformtcleart	translatet
dpi_transform(R?RYR3RZR[tclip((s:/usr/lib64/python2.7/site-packages/matplotlib/offsetbox.pyR<�s				
cCs|j|jS(sf
        Return the :class:`~matplotlib.transforms.Transform` applied
        to the children
        (R�R�(R?((s:/usr/lib64/python2.7/site-packages/matplotlib/offsetbox.pyt
get_transformscCsdS(s+
        set_transform is ignored.
        N((R?tt((s:/usr/lib64/python2.7/site-packages/matplotlib/offsetbox.pyt
set_transformscCs5||_|jj�|jj|d|d�dS(sj
        set offset of the container.

        Accept : tuple of x,y cooridnate in disokay units.
        iiN(R>R�R�R�(R?RV((s:/usr/lib64/python2.7/site-packages/matplotlib/offsetbox.pyRW s	
cCs|jS(s1
        return offset of the container.
        (R>(R?((s:/usr/lib64/python2.7/site-packages/matplotlib/offsetbox.pyR]+scCsN|j|�\}}}}|j�\}}tjj||||||�S(s8
        get the bounding box in display space.
        (RgR]RhRRi(R?R\R&R5ReRfRrRs((s:/usr/lib64/python2.7/site-packages/matplotlib/offsetbox.pyRl1scCs;|jd�}|j||j||j||j|fS(s@
        Return with, height, xdescent, ydescent of box
        g�?(RzRYR3RZR[(R?R\tdpi_cor((s:/usr/lib64/python2.7/site-packages/matplotlib/offsetbox.pyRg:scCs6|jj|�|j�s2|j|j��ndS(s?Add any :class:`~matplotlib.artist.Artist` to the container boxN(R=tappendtis_transform_setR�R�(R?RT((s:/usr/lib64/python2.7/site-packages/matplotlib/offsetbox.pyt
add_artistCsc	Csv|jd�}|jj�|jj||�x|jD]}|j|�q9Wt||dtdtdd��dS(s#
        Draw the children
        g�?RmRnRogN(	RzR�R�tscaleR=RpRRRRq(R?R\R�RP((s:/usr/lib64/python2.7/site-packages/matplotlib/offsetbox.pyRpIs
(
RtRuRvR�R<R�R�RWR]RlRgR�Rp(((s:/usr/lib64/python2.7/site-packages/matplotlib/offsetbox.pyR��s									tTextAreacBs�eZdZdded�Zd�Zd�Zd�Zd�Z	d�Z
d�Zd�Zd	�Z
d
�Zd�Zd�Zd
�ZRS(s�
    The TextArea is contains a single Text instance. The text is
    placed at (0,0) with baseline+left alignment. The width and height
    of the TextArea instance is the width and height of the its child
    text.
    cCs�|dkri}nd|kr.d|d<ntjdd||�|_tj|�|jg|_tj�|_	|j	j
�|j	jdd�tj�|_|jj
|j	|j�||_||_dS(s�
        *s* : a string to be displayed.
        *textprops* : property dictionary for the text
        *multilinebaseline* : If True, baseline for multiline text is
                              adjusted so that it is (approximatedly)
                              center-aligned with singleline text.
        *minimumdescent*  : If True, the box has a minimum descent of "p".
        tvaR,iN(RtmtexttTextt_textR:R<R=RhR�R�R�R�t_baseline_transformR�t_multilinebaselinet_minimumdescent(R?tst	textpropstmultilinebaselinetminimumdescent((s:/usr/lib64/python2.7/site-packages/matplotlib/offsetbox.pyR<_s
	


	cCs|jj|�dS(sset textN(R�tset_text(R?R�((s:/usr/lib64/python2.7/site-packages/matplotlib/offsetbox.pyR��scCs
|jj�S(sget text(R�tget_text(R?((s:/usr/lib64/python2.7/site-packages/matplotlib/offsetbox.pyR��scCs
||_dS(s�
        Set multilinebaseline .

        If True, baseline for multiline text is
        adjusted so that it is (approximatedly) center-aligned with
        singleline text.
        N(R�(R?R�((s:/usr/lib64/python2.7/site-packages/matplotlib/offsetbox.pytset_multilinebaseline�scCs|jS(s)
        get multilinebaseline .
        (R�(R?((s:/usr/lib64/python2.7/site-packages/matplotlib/offsetbox.pytget_multilinebaseline�scCs
||_dS(s�
        Set minimumdescent .

        If True, extent of the single line text is adjusted so that
        it has minimum descent of "p"
        N(R�(R?R�((s:/usr/lib64/python2.7/site-packages/matplotlib/offsetbox.pytset_minimumdescent�scCs|jS(s%
        get minimumdescent.
        (R�(R?((s:/usr/lib64/python2.7/site-packages/matplotlib/offsetbox.pytget_minimumdescent�scCsdS(s+
        set_transform is ignored.
        N((R?R�((s:/usr/lib64/python2.7/site-packages/matplotlib/offsetbox.pyR��scCs5||_|jj�|jj|d|d�dS(sk
        set offset of the container.

        Accept : tuple of x,y coordinates in display units.
        iiN(R>R�R�R�(R?RV((s:/usr/lib64/python2.7/site-packages/matplotlib/offsetbox.pyRW�s	
cCs|jS(s1
        return offset of the container.
        (R>(R?((s:/usr/lib64/python2.7/site-packages/matplotlib/offsetbox.pyR]�scCsN|j|�\}}}}|j�\}}tjj||||||�S(s8
        get the bounding box in display space.
        (RgR]RhRRi(R?R\R&R5ReRfRrRs((s:/usr/lib64/python2.7/site-packages/matplotlib/offsetbox.pyRl�scCsX|jj|jj�\}}|jd|jjdt�\}}}|jj|�\}}|j|j}	}
|dd}|j||jjd|�\}}}
|
}|jj	�t
|�dkr	|jr	d|
d||}|jjd||�|}n?t
|||
|�}|j�r>t
||�}n||}
|	|
d|fS(Ntlptismathi����iig�?g(R�tis_math_texttget_text_width_height_descentt_fontpropertiesRRt_get_layoutRYR3R�R�RR�R�RR�(R?R\t
clean_lineR�t_th_td_R�tinfoR&R5tlinethhtddR6td_newth_d((s:/usr/lib64/python2.7/site-packages/matplotlib/offsetbox.pyRg�s&!!
	
c	Cs6|jj|�t||dtdtdd��dS(s#
        Draw the children
        RmRnRogN(R�RpRRRRq(R?R\((s:/usr/lib64/python2.7/site-packages/matplotlib/offsetbox.pyRp�sN(RtRuRvRR�R<R�R�R�R�R�R�R�RWR]RlRgRp(((s:/usr/lib64/python2.7/site-packages/matplotlib/offsetbox.pyR�Xs  			
									#tAuxTransformBoxcBs_eZdZd�Zd�Zd�Zd�Zd�Zd�Zd�Z	d�Z
d	�ZRS(
sY
    Offset Box with the aux_transform . Its children will be
    transformed with the aux_transform first then will be
    offseted. The absolute coordinate of the aux_transform is meaning
    as it will be automatically adjust so that the left-lower corner
    of the bounding box of children will be set to (0,0) before the
    offset transform.

    It is similar to drawing area, except that the extent of the box
    is not predetermined but calculated from the window extent of its
    children. Furthermore, the extent of the children will be
    calculated in the transformed coordinate.
    cCse||_tj|�tj�|_|jj�|jjdd�tj�|_|jj�dS(Ni(	t
aux_transformR:R<RhR�R�R�R�tref_offset_transform(R?R�((s:/usr/lib64/python2.7/site-packages/matplotlib/offsetbox.pyR<s	

cCs'|jj|�|j|j��dS(s?Add any :class:`~matplotlib.artist.Artist` to the container boxN(R=R�R�R�(R?RT((s:/usr/lib64/python2.7/site-packages/matplotlib/offsetbox.pyR�scCs|j|j|jS(sf
        Return the :class:`~matplotlib.transforms.Transform` applied
        to the children
        (R�R�R�(R?((s:/usr/lib64/python2.7/site-packages/matplotlib/offsetbox.pyR�s
cCsdS(s+
        set_transform is ignored.
        N((R?R�((s:/usr/lib64/python2.7/site-packages/matplotlib/offsetbox.pyR�scCs5||_|jj�|jj|d|d�dS(sj
        set offset of the container.

        Accept : tuple of x,y coordinate in disokay units.
        iiN(R>R�R�R�(R?RV((s:/usr/lib64/python2.7/site-packages/matplotlib/offsetbox.pyRW%s	
cCs|jS(s1
        return offset of the container.
        (R>(R?((s:/usr/lib64/python2.7/site-packages/matplotlib/offsetbox.pyR]0scCsN|j|�\}}}}|j�\}}tjj||||||�S(s8
        get the bounding box in display space.
        (RgR]RhRRi(R?R\R&R5ReRfRrRs((s:/usr/lib64/python2.7/site-packages/matplotlib/offsetbox.pyRl6scCs�|jj�}|jj�|jj�g|jD]}|j|�^q3}tjj|�}|jj	|j
|j�|jj|�}|jj
|�|j|jddfS(Ng(R�t	to_valuesR�R�R=RlRhRtunionR�R�R�tmatrix_from_valuest
set_matrixRYR3(R?R\t_offRPtbboxestubtmtx((s:/usr/lib64/python2.7/site-packages/matplotlib/offsetbox.pyRg>s

%c	CsGx|jD]}|j|�q
Wt||dtdtdd��dS(s#
        Draw the children
        RmRnRogN(R=RpRRRRq(R?R\RP((s:/usr/lib64/python2.7/site-packages/matplotlib/offsetbox.pyRpRs(RtRuRvR<R�R�R�RWR]RlRgRp(((s:/usr/lib64/python2.7/site-packages/matplotlib/offsetbox.pyR��s
									tAnchoredOffsetboxcBs�eZdZdZddddeddd�Zd�Zd�Zd�Z	d�Z
d	�Zdd
�Zd�Z
dd�Zdd
�Zd�Zd�ZRS(s7
    An offset box placed according to the legend location
    loc. AnchoredOffsetbox has a single child. When multiple children
    is needed, use other OffsetBox class to enclose them.  By default,
    the offset box is anchored against its parent axes. You may
    explicitly specify the bbox_to_anchor.
    ig�������?g�?c	
Ks"tt|�j|	�|j||�|j|�||_||_||_|dkrst	dt
d�|_nMt|t
�r�t	|�|_d|kr�|jjt
d�q�n	||_tdddddddd	d
dd|jj�d
t�|_|jjddd�||_dS(s�
        loc is a string or an integer specifying the legend location.
        The valid  location codes are::

        'upper right'  : 1,
        'upper left'   : 2,
        'lower left'   : 3,
        'lower right'  : 4,
        'right'        : 5,
        'center left'  : 6,
        'center right' : 7,
        'lower center' : 8,
        'upper center' : 9,
        'center'       : 10,

        pad : pad around the child for drawing a frame. given in
          fraction of fontsize.

        borderpad : pad between offsetbox frame and the bbox_to_anchor,

        child : OffsetBox instance that will be anchored.

        prop : font property. This is only used as a reference for paddings.

        frameon : draw a frame box if True.

        bbox_to_anchor : bbox to anchor. Use self.axes.bbox if None.

        bbox_transform : with which the bbox_to_anchor will be transformed.

        tsizeslegend.fontsizeRVgRYg�?R3R�R&R�R�R�R�R�RoiN(gg(R;R�R<tset_bbox_to_anchort	set_childtloct	borderpadRoRRR	tpropRJRqtset_sizeRtget_size_in_pointsR�R�R�R�(
R?R�RoR�R�R�tframeontbbox_to_anchortbbox_transformR((s:/usr/lib64/python2.7/site-packages/matplotlib/offsetbox.pyR<gs(%
				cCs
||_dS(sset the child to be anchoredN(t_child(R?R�((s:/usr/lib64/python2.7/site-packages/matplotlib/offsetbox.pyR��scCs|jS(sreturn the child(R�(R?((s:/usr/lib64/python2.7/site-packages/matplotlib/offsetbox.pyt	get_child�scCs
|jgS(sreturn the list of children(R�(R?((s:/usr/lib64/python2.7/site-packages/matplotlib/offsetbox.pyRN�scCsn|j�j|�\}}}}|j|jj��}|j|}|d||d|||||fS(sq
        return the extent of the artist. The extent of the child
        added with the pad is returned
        i(R�RgRzR�R�Ro(R?R\R&R5ReRfR�Ro((s:/usr/lib64/python2.7/site-packages/matplotlib/offsetbox.pyRg�s!
cCsI|jdkr|jjS|j}|dkr5|jSt|j|�SdS(sB
        return the bbox that the legend will be anchored
        N(t_bbox_to_anchorRtaxesR�t_bbox_to_anchor_transformR(R?t	transform((s:/usr/lib64/python2.7/site-packages/matplotlib/offsetbox.pytget_bbox_to_anchor�s
		cCs�|dkst|t�r'||_nuyt|�}Wn'tk
r`tdt|���nX|dkr�|d|dddg}ntj	|�|_||_
dS(sF
        set the bbox that the child will be anchored.

        *bbox* can be a Bbox instance, a list of [left, bottom, width,
        height], or a list of [left, bottom] where the width and
        height will be assumed to be zero. The bbox will be
        transformed to display coordinate by the given transform.
        sInvalid argument for bbox : %siiiN(RRJRR�Rt	TypeErrorRtstrRRiR�(R?R�R�tl((s:/usr/lib64/python2.7/site-packages/matplotlib/offsetbox.pyR��s	
cCsg|j|�|j|�\}}}}|j|||||�\}}tj||||||�S(s8
        get the bounding box in display space.
        (t_update_offset_funcRgR]RRi(R?R\R&R5ReRfRrRs((s:/usr/lib64/python2.7/site-packages/matplotlib/offsetbox.pyRl�s
!cCsG|dkr'|j|jj��}n||d�}|j|�dS(ss
        Update the offset func which depends on the dpi of the
        renderer (because of the padding).
        cSsdtjdd||�}|j|}|j�}	|j|j||	|�\}
}|
|||fS(Ni(RRiR�R�t_get_anchored_bboxR�(R&R5ReRfR\R�R?R�R�R�R�R�((s:/usr/lib64/python2.7/site-packages/matplotlib/offsetbox.pyR>�s
N(RRzR�R�RW(R?R\R�R>((s:/usr/lib64/python2.7/site-packages/matplotlib/offsetbox.pyR��scCsB|jj|j|j|j|j�|r>|jj|�ndS(N(R�R�R�R�RYR3R�(R?R�R�((s:/usr/lib64/python2.7/site-packages/matplotlib/offsetbox.pyR�sc
Cs�|j�sdS|j|jj��}|j||�|jrs|j|�}|j||�|jj	|�n|j
|�\}}}}|j|||||�\}}	|j�j
||	f�|j�j	|�dS(sdraw the artistN(R`RzR�R�R�R�RlR�R�RpRgR]R�RW(
R?R\R�R�RYR3RZR[RjRk((s:/usr/lib64/python2.7/site-packages/matplotlib/offsetbox.pyRp	s	!cCs�|tdd�kst�td�\}}}}}	}
}}}
}}i
d|6d|6d|6d|	6d|
6d|6d|6d	|
6d
|6d|6}||}|j|�}|j|d|�}|j|jfS(
s{
        return the position of the bbox anchored at the parentbbox
        with the loc code, with the borderpad.
        iitNEtNWtSWtSEtEtWtStNtCt	container(RtAssertionErrortpaddedtanchoredR�R�(R?R�R�t
parentbboxR�tBESTtURtULtLLtLRtRtCLtCRtLCtUCR�tanchor_coefsRPR�tanchored_box((s:/usr/lib64/python2.7/site-packages/matplotlib/offsetbox.pyR�s -


N(RtRuRvtzorderRR�R<R�R�RNRgR�R�RlR�R�RpR�(((s:/usr/lib64/python2.7/site-packages/matplotlib/offsetbox.pyR�]s"	<								tAnchoredTextcBs eZdZdddd�ZRS(s%
    AnchoredOffsetbox with Text
    g�������?g�?cKset|d|dt�|_|jjj�}tt|�j|d|d|d|jd||�dS(sC
        *s* : string
        *loc* : location code
        *prop* : font property
        *pad* : pad between the text and the frame as fraction of the font size.
        *borderpad* : pad between the frame and the axes (or bbox_to_anchor).

        other keyword parameters of AnchoredOffsetbox are also allowed.
        R�R�RoR�R�R�N(R�RRttxtR�tget_fontpropertiesR;RR<(R?R�R�RoR�R�Rtfp((s:/usr/lib64/python2.7/site-packages/matplotlib/offsetbox.pyR<?s!	N(RtRuRvRR<(((s:/usr/lib64/python2.7/site-packages/matplotlib/offsetbox.pyR:stOffsetImagec
Bs}eZdddddddeed�	Zd�Zd�Zd�Zd�Z	d�Z
d�Zd	�Zd
�Z
d�ZRS(
ig@cKs�|
|_td|jd|d|d|d|d|d|d|	|�|_|jg|_|j|�|j|�tj|�dS(	NR�tcmaptnormt
interpolationtorigint
filternormt	filterradtresample(	t_dpi_corRRltimageR=tset_zoomtset_dataR:R<(R?tarrtzoomR
RRRRRRR�R((s:/usr/lib64/python2.7/site-packages/matplotlib/offsetbox.pyR<Us
	

cCs)tj|�|_|jj|j�dS(N(Rtasarrayt_dataRR(R?R((s:/usr/lib64/python2.7/site-packages/matplotlib/offsetbox.pyRvscCs|jS(N(R(R?((s:/usr/lib64/python2.7/site-packages/matplotlib/offsetbox.pytget_datazscCs
||_dS(N(t_zoom(R?R((s:/usr/lib64/python2.7/site-packages/matplotlib/offsetbox.pyR}scCs|jS(N(R(R?((s:/usr/lib64/python2.7/site-packages/matplotlib/offsetbox.pytget_zoom�scCs|jS(s1
        return offset of the container.
        (R>(R?((s:/usr/lib64/python2.7/site-packages/matplotlib/offsetbox.pyR]�scCs
|jgS(N(R(R?((s:/usr/lib64/python2.7/site-packages/matplotlib/offsetbox.pyRN�scCsN|j|�\}}}}|j�\}}tjj||||||�S(s8
        get the bounding box in display space.
        (RgR]RhRRi(R?R\R&R5ReRfRrRs((s:/usr/lib64/python2.7/site-packages/matplotlib/offsetbox.pyRl�sc	Csq|jr|jd�}nd}|j�}|j�}|jd \}}||||}}||ddfS(Ng�?ii(RRzRRtshape(	R?R\R�RtdatatnytnxR&R5((s:/usr/lib64/python2.7/site-packages/matplotlib/offsetbox.pyRg�s	cCs|jj|�dS(s#
        Draw the children
        N(RRp(R?R\((s:/usr/lib64/python2.7/site-packages/matplotlib/offsetbox.pyRp�sN(RtRuRRRR�R<RRRRR]RNRlRgRp(((s:/usr/lib64/python2.7/site-packages/matplotlib/offsetbox.pyRTs$								(t_AnnotationBasetAnnotationBboxcBs�eZdZdZd�Zejdddeddddddd�
�Z	d�Z
d�Zd	�Zdd
�Z
dd�Zd�Zd
�Zd�ZRS(sD
    Annotation-like class, but with offsetbox instead of Text.
    icCsd|jd|jdfS(NsAnnotationBbox(%g,%g)ii(RV(R?((s:/usr/lib64/python2.7/site-packages/matplotlib/offsetbox.pyt__str__�sR g�������?g�?c
Ks/||_||_|j|�|dk	r^|jjdd�|_tdd|j�|_nd|_d|_tj	||d|d|d|d|�t
jj	||
�|	|_t
d	dddd
dddddd|jj�dt�|_|jjdd|�|
r"|jj|
�n||_dS(so
        *offsetbox* : OffsetBox instance

        *xycoords* : same as Annotation but can be a tuple of two
           strings which are interpreted as x and y coordinates.

        *boxcoords* : similar to textcoords as Annotation but can be a
           tuple of two strings which are interpreted as x and y
           coordinates.

        *box_alignment* : a tuple of two floats for a vertical and
           horizontal alignment of the offset box w.r.t. the *boxcoords*.
           The lower-left corner is (0.0) and upper-right corner is (1.1).

        other parameters are identical to that of Annotation.
        trelposg�?iitxytexttxycoordst
textcoordstannotation_clipRVgRYg�?R3R�R&R�R�R�R�R�RoN(g�?g�?(ii(ii(gg(t	offsetboxt
arrowpropstset_fontsizeRtpopt
_arrow_relposRtarrow_patchR#R<RARBt_box_alignmentRR�R�R�R�R�tsetR�(R?R+RVtxyboxR(t	boxcoordsR�RoR*t
box_alignmentt	bboxpropsR,R�R((s:/usr/lib64/python2.7/site-packages/matplotlib/offsetbox.pyR<�s0		
					cCs"|jj|�\}}||fS(N(R+RQ(R?teventR�ttinfo((s:/usr/lib64/python2.7/site-packages/matplotlib/offsetbox.pyRQscCs2|j|jg}|jr.|j|j�n|S(N(R+R�R0R�(R?Rx((s:/usr/lib64/python2.7/site-packages/matplotlib/offsetbox.pyRNs	cCsI|jdk	r"|jj|�n|jj|�tjj||�dS(N(R0RRMR+RARB(R?RO((s:/usr/lib64/python2.7/site-packages/matplotlib/offsetbox.pyRMscCs/|dkrtd}ntd|�|_dS(s(
        set fontsize in points
        slegend.fontsizeR�N(RR	RR�(R?R�((s:/usr/lib64/python2.7/site-packages/matplotlib/offsetbox.pyR-s
cCs
|jj�S(s+
        return fontsize in points
        (R�R�(R?R�((s:/usr/lib64/python2.7/site-packages/matplotlib/offsetbox.pytget_fontsize%scCsd|j|�}|j||�|j|j��}|jj|�|jr`|jj|�ndS(s?Update the pixel positions of the annotated point and the text.N(t_get_position_xyt_update_position_xyboxRzR9R�R�R0(R?R\txy_pixelR�((s:/usr/lib64/python2.7/site-packages/matplotlib/offsetbox.pytupdate_positions+s	cCs1|j\}}t|jt�r||j\}}|j||||�\}}|j||||�\}	}
||
}}n!|j||||j�\}}|jj|�\}
}}}|j\}}|jj|||
|||||f�|jj	|�}|j
j|j|j
|j|j�|\}}||}}|jr-||}}|jj�}|j}|j|j|d}|j
|j|d}|jj||f||f�|jj�}|jd|�}|j|�}|jj|�|jd|j
�}|jj|�ndS(sFUpdate the pixel positions of the annotation text and the arrow patch.iiR�tpatchAN(R'RJR)ttuplet_get_xyR+RgR1RWRlR�R�R�R�RYR3R,tcopyR/R0t
set_positionsR�R�R.RzR�t
set_patchA(R?R\R<txtytxcoordtycoordtx1ty1tx2ty2tox0toy0R&R5ReRft_fwt_fhR�tox1toy1R�R�R6R&tfsR�R>((s:/usr/lib64/python2.7/site-packages/matplotlib/offsetbox.pyR;6s8!.
	
	cCs�|dk	r||_n|j�s(dS|j|�}|j||�sMdS|j|�|jdk	r�|jjdkr�|jdk	r�|j|j_n|jj|�n|j	r�|j
j|�n|jj|�dS(sN
        Draw the :class:`Annotation` object to the given *renderer*.
        N(Rt	_rendererR`R:t	_check_xyR=R0tfigureRpR�R�R+(R?R\R<((s:/usr/lib64/python2.7/site-packages/matplotlib/offsetbox.pyRpos
!	N(g�?g�?(RtRuRvRR%R
tdedent_interpdRR�R<RQRNRMR-R9R=R;Rp(((s:/usr/lib64/python2.7/site-packages/matplotlib/offsetbox.pyR$�s*	7	
					9t
DraggableBasecBskeZdZed�Zd�Zd�Zd�Zd�Zd�Z	d�Z
d�Zd	�Zd
�Z
RS(s,
    helper code for a draggable artist (legend, offsetbox)
    The derived class must override following two method.

      def saveoffset(self):
          pass

      def update_offset(self, dx, dy):
          pass

    *saveoffset* is called when the object is picked for dragging and it is
    meant to save reference position of the artist.

    *update_offset* is called during the dragging. dx and dy is the pixel
     offset from the point where the mouse drag started.

    Optionally you may override following two methods.

      def artist_picker(self, artist, evt):
          return self.ref_artist.contains(evt)

      def finalize_offset(self):
          pass

    *artist_picker* is a picker method that will be
     used. *finalize_offset* is called when the mouse is released. In
     current implementaion of DraggableLegend and DraggableAnnotation,
     *update_offset* places the artists simply in display
     coordinates. And *finalize_offset* recalculate their position in
     the normalized axes coordinate and set a relavant attribute.

    cCs�||_t|_||_|jjj|_|jjd|j�}|jjd|j�}|j	|j
�||g|_dS(Nt
pick_eventtbutton_release_event(t
ref_artistRRt
got_artistt	_use_blitRUtcanvastmpl_connectton_pickt
on_releaset
set_pickert
artist_pickertcids(R?RZtuse_blittc2tc3((s:/usr/lib64/python2.7/site-packages/matplotlib/offsetbox.pyR<�s			cCsM|jrI|j|j}|j|j}|j||�|jj�ndS(N(R[RDtmouse_xREtmouse_yt
update_offsetR]Rp(R?tevttdxtdy((s:/usr/lib64/python2.7/site-packages/matplotlib/offsetbox.pyt	on_motion�s
	cCs�|jr�|j|j}|j|j}|j||�|jj|j�|j	j
|j	jj�|jj
|j	jj�ndS(N(R[RDRgRERhRiR]trestore_regiont
backgroundRZRpRUt_cachedRenderertblitR�(R?RjRkRl((s:/usr/lib64/python2.7/site-packages/matplotlib/offsetbox.pyton_motion_blit�s	cCs�|j|jkr�|jj|_|jj|_t|_|j	r�|jj
t�|jj�|jj
|jjj�|_|jj|jjj�|jj|jjj�|jjd|j�|_n|jjd|j�|_|j�ndS(Ntmotion_notify_event(tartistRZRSRDRgRERhR�R[R\tset_animatedR]Rptcopy_from_bboxRUR�RoRpRqR^Rrt_c1Rmtsave_offset(R?Rj((s:/usr/lib64/python2.7/site-packages/matplotlib/offsetbox.pyR_�s		
cCsR|jrN|j�t|_|jj|j�|jrN|jjt�qNndS(N(	R[tfinalize_offsetRRR]tmpl_disconnectRwR\RZRu(R?R7((s:/usr/lib64/python2.7/site-packages/matplotlib/offsetbox.pyR`�s	
		cCs(x!|jD]}|jj|�q
WdS(sdisconnect the callbacksN(RcR]Rz(R?tcid((s:/usr/lib64/python2.7/site-packages/matplotlib/offsetbox.pyt
disconnect�scCs|jj|�S(N(RZRQ(R?RtRj((s:/usr/lib64/python2.7/site-packages/matplotlib/offsetbox.pyRb�scCsdS(N((R?((s:/usr/lib64/python2.7/site-packages/matplotlib/offsetbox.pyRx�scCsdS(N((R?RkRl((s:/usr/lib64/python2.7/site-packages/matplotlib/offsetbox.pyRi�scCsdS(N((R?((s:/usr/lib64/python2.7/site-packages/matplotlib/offsetbox.pyRy�s(RtRuRvRRR<RmRrR_R`R|RbRxRiRy(((s:/usr/lib64/python2.7/site-packages/matplotlib/offsetbox.pyRW�s 										tDraggableOffsetBoxcBs/eZed�Zd�Zd�Zd�ZRS(cCs#tj||d|�||_dS(NRd(RWR<R+(R?RZR+Rd((s:/usr/lib64/python2.7/site-packages/matplotlib/offsetbox.pyR<�scCsq|j}|jj}|j|�\}}}}|j|||||�}|\|_|_|jj|�dS(N(R+RURpRgR]toffsetbox_xtoffsetbox_yRW(R?R+R\R&R5ReRfRH((s:/usr/lib64/python2.7/site-packages/matplotlib/offsetbox.pyRx�s	cCs.|j||j|f}|jj|�dS(N(R~RR+RW(R?RkRlt
loc_in_canvas((s:/usr/lib64/python2.7/site-packages/matplotlib/offsetbox.pyRisc
CsW|j}|jj}|j|�\}}}}|j\}}||||f}	|	S(N(R+RURpRgR>(
R?R+R\R&R5ReRfRrRsR�((s:/usr/lib64/python2.7/site-packages/matplotlib/offsetbox.pytget_loc_in_canvass	(RtRuRRR<RxRiR�(((s:/usr/lib64/python2.7/site-packages/matplotlib/offsetbox.pyR}�s		tDraggableAnnotationcBs/eZed�Zd�Zd�Zd�ZRS(cCs#tj||d|�||_dS(NRd(RWR<t
annotation(R?R�Rd((s:/usr/lib64/python2.7/site-packages/matplotlib/offsetbox.pyR<scCs�|j}|j\}}t|jt�r�|j\}}|j|jj|||�\}}|j|jj|||�\}}	||	}
}n'|j|jj|||j�\}
}|
||_|_	d|j_|j
dd�dS(Ns
figure pixelsi(R�R'RJR)R?R@R]R\RrRsRi(R?tannRDRERFRGRHRIRJRKRLRM((s:/usr/lib64/python2.7/site-packages/matplotlib/offsetbox.pyRxs	$$'cCsZ|j}|j||j|f|_|j\}}|j|jj|||j�}dS(N(R�RrRsR'R@R]R\R)(R?RkRlR�RDRERV((s:/usr/lib64/python2.7/site-packages/matplotlib/offsetbox.pyRi$s	cCsL|jj}d|j_|jjjj�j|�}t|�|j_dS(Ns
axes fraction(R�R'R)R�t	transAxestinvertedttransform_pointR?(R?R�tpos_axes_fraction((s:/usr/lib64/python2.7/site-packages/matplotlib/offsetbox.pyRy*s(RtRuRRR<RxRiRy(((s:/usr/lib64/python2.7/site-packages/matplotlib/offsetbox.pyR�s		t__main__iiyiigp@RiRRidg�?R3iR(R R4s
offset pointsR�Rog�������?R6tboxstyletroundtfcRER�R,t
arrowstyles->(idid(g�?g�?(ii(NRvt
__future__Rtmatplotlib.transformst
transformsRhtmatplotlib.artistRtRAtmatplotlib.textttextR�tnumpyRRRRRRtmatplotlib.font_managerRtmatplotlib.patchesRRt
matplotlibR	R
tmatplotlib.cbookRDtmatplotlib.imageRRRRRR
R+R9RBR:RwRyR�R�R�R�R�R�RRR#R$tobjectRWR}R�Rttmatplotlib.pyplottpyplottpltRUROtclftsubplottaxRqRtarangetreshapeRTRtmyimageR�RWtmyimage2R�R�Rptshow(((s:/usr/lib64/python2.7/site-packages/matplotlib/offsetbox.pyt<module>s~(		/%�C@P`�h�e�j!
			

		



Anon7 - 2021