HEX
Server: LiteSpeed
System: Linux standart9.isimtescil.net 3.10.0-962.3.2.lve1.5.26.7.el7.x86_64 #1 SMP Wed Oct 2 07:53:12 EDT 2019 x86_64
User: karalev (5310)
PHP: 8.2.29
Disabled: NONE
Upload Files
File: //proc/self/root/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/legend.pyo
�
�)�Uc@ sTdZddlmZddlZddlZddlmZddlm	Z	m
Z
ddlmZm
Z
mZmZddlmZddlmZdd	lmZmZmZmZdd
lmZmZmZddlmZmZm Z m!Z!m"Z"ddl#m$Z$m%Z%m&Z&m'Z'm(Z(d
e(fd��YZ)de	fd��YZ*dS(s
Place a legend on the axes at location loc.  Labels are a
sequence of strings and loc can be a string or an integer
specifying the legend location

The location codes are

  'best'         : 0, (only implemented for axis legends)
  '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,

Return value is a sequence of text, line instances that make
up the legend
i����(tdivisionN(trcParams(tArtisttallow_rasterization(tis_string_liketiterabletsilent_listtsafezip(tFontProperties(tLine2D(tPatcht	RectangletShadowtFancyBboxPatch(tLineCollectiontRegularPolyCollectiontCircleCollection(tBboxtBboxBasetTransformedBboxtBboxTransformTotBboxTransformFrom(tHPackertVPackertTextAreatDrawingAreatDraggableOffsetBoxtDraggableLegendcB s&eZed�Zd�Zd�ZRS(cC s)||_tj|||jd|�dS(Ntuse_blit(tlegendRt__init__t_legend_box(tselfRR((sD/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/legend.pyR*s	cC s|jjj|�S(N(RtlegendPatchtcontains(R Rtevt((sD/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/legend.pyt
artist_picker/scC s�|j�}|jj�}|jdks9|jdkr[|jjd�|jj�}nt|�}t|j	|��|j_
dS(Ni(tget_loc_in_canvasRtget_bbox_to_anchortwidththeighttset_bbox_to_anchortNoneRttuplettransform_pointt_loc(R t
loc_in_canvastbboxt_bbox_transform((sD/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/legend.pytfinalize_offset2s(t__name__t
__module__tFalseRR$R1(((sD/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/legend.pyR)s	tLegendcB s�eZdZidd6dd6dd6dd6d	d
6dd6d
d6dd6dd6dd6dd6ZdZd�Zeeedeeeeeeeeeeeeedeeeeeeed�Zd�Z	d�Z
d�Zeee
�Z
d�Zd�Zed��Zed�Zd �Zd!�Zd"�Zd#�Zd$�Zd%�Zd&�Zd'�Zd(�Zd)�Zd*�Zd+�Zd,�Zd-�Z ed.�Z!d/�Z"ed0�Z#ee$d1�Z%RS(2s�
    Place a legend on the axes at location loc.  Labels are a
    sequence of strings and loc can be a string or an integer
    specifying the legend location

    The location codes are::

      'best'         : 0, (only implemented for axis legends)
      '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,

    loc can be a tuple of the noramilzed coordinate values with
    respect its parent.

    Return value is a sequence of text, line instances that make
    up the legend
    itbestisupper rightis
upper leftis
lower leftislower rightitrightiscenter leftiscenter rightislower centeri	supper centeri
tcentercC sdS(NR5((R ((sD/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/legend.pyt__str__lsc)C s�ddlm}ddlm}tj|�|	d7krRtdtd�|_	nMt
|	t�r�t|	�|_	d|	kr�|j	jtd�q�n	|	|_	|j	j
�|_dddd	d
g}g|_g|_d7|_t�} xI|D]A}!| |!d7krtd|!}"n
| |!}"t||!|"�q�Widd
6dd6dd6dd6dd6}#|j}$t|$j|$j�|j}%x�|#j�D]�\}&}'| |&d7k	r�| |'d7kr�tjd|'|&ft�t||'| |&|%�q�n| |'d7kr t||'td|'�q�t||'| |'�q�W~ t|�}t|�dkrbd}n||_|jdkr�t d|��n|d7kr�t!j"d8d9d:g�|_#nt!j$|�|_#t%|j&t|j#��d}(t!j'|j#|(�|j& |_#d7|_(t
||�rIt)|_*|j+|�|j,|j-�n4t
||�rqt.|_*|j,|�nt/d��||_0|d7kr�td }|j*r�|d;kr�d"}q�nt1|�rV||j2krF|j*rtjd#|d$j3|j2j4��f�d}qStjd%|d$j3|j2j4��f�d}qV|j2|}n|j*r�|dkr�tjd&�d}n||_5|j6||�t7d'd<d)d*d+d*d,td-d.td/d0|jd1t)�|_8|d7kr�td2}n|t)kr |j8j9d3d
dd4d5�n|j8j9d6d
d�|j:|j8�||_;|j<||�||_=|j>|�|j|_?d7|_@d7S(=s~	
        - *parent* : the artist that contains the legend
        - *handles* : a list of artists (lines, patches) to add to the legend
        - *labels* : a list of strings to label the legend

        Optional keyword arguments:

        ================   ==================================================================
        Keyword            Description
        ================   ==================================================================
        loc                a location code
        prop               the font property
        markerscale        the relative size of legend markers vs. original
        numpoints          the number of points in the legend for line
        scatterpoints      the number of points in the legend for scatter plot
        scatteryoffsets    a list of yoffsets for scatter symbols in legend
        frameon            if True, draw a frame (default is True)
        fancybox           if True, draw a frame with a round fancybox.  If None, use rc
        shadow             if True, draw a shadow behind legend
        ncol               number of columns
        borderpad          the fractional whitespace inside the legend border
        labelspacing       the vertical space between the legend entries
        handlelength       the length of the legend handles
        handletextpad      the pad between the legend handle and text
        borderaxespad      the pad between the axes and legend border
        columnspacing      the spacing between columns
        title              the legend title
        bbox_to_anchor     the bbox that the legend will be anchored.
        bbox_transform     the transform for the bbox. transAxes if None.
        ================   ==================================================================


The pad and spacing parameters are measure in font-size units.  E.g.,
a fontsize of 10 points and a handlelength=5 implies a handlelength of
50 points.  Values from rcParams will be used if None.

Users can specify any arbitrary location for the legend using the
*bbox_to_anchor* keyword argument. bbox_to_anchor can be an instance
of BboxBase(or its derivatives) or a tuple of 2 or 4 floats.
See :meth:`set_bbox_to_anchor` for more detail.

The legend location can be specified by setting *loc* with a tuple of
2 floats, which is interpreted as the lower-left corner of the legend
in the normalized axes coordinate.
        i����(tAxes(tFiguretsizeslegend.fontsizet	numpointstmarkerscaletshadowt
columnspacingt
scatterpointsslegend.t	borderpadtpadtlabelspacingtlabelsepthandlelengtht	handlelent
handletextpadt
handletextsept
borderaxespadtaxespadsUse '%s' instead of '%s'.iiis!numpoints must be >= 0; it was %dg@g @g@g@s,Legend needs either Axes or Figure as parents
legend.locR6supper rightsLUnrecognized location "%s". Falling back on "best"; valid locations are
	%s
s
	sSUnrecognized location "%s". Falling back on "upper right"; valid locations are
	%s
siAutomatic legend placement (loc="best") not implemented for figure legend. Falling back on "upper right".txygR'g�?R(t	facecolorsaxes.facecolort	edgecolorsaxes.edgecolortmutation_scaletsnapslegend.fancyboxtroundt
rounding_sizeg�������?tsquareNg�?g�?g�?(iR6(gg(Atmatplotlib.axesR:tmatplotlib.figureR;RRR*RRtpropt
isinstancetdicttset_sizetget_size_in_pointst	_fontsizettextst
legendHandlest_legend_title_boxtlocalstsetattrR/tminR'R(titemstwarningstwarntDeprecationWarningtlisttlent_ncolR=t
ValueErrortnptarrayt_scatteryoffsetstasarraytintRAttileRtTruetisaxestset_axest
set_figuretfigureR4t	TypeErrortparentRtcodestjointkeyst_modeR)R
R!tset_boxstylet_set_artist_propst
_drawFramet_init_legend_boxR-t	set_titlet_last_fontsize_pointst
_draggable()R RvthandlestlabelstlocR=R>RAtscatteryoffsetsRVRCRERGRIRKRBRDRFRHRJR@tncoltmodetfancyboxR?ttitletbbox_to_anchortbbox_transformtframeonR:R;t	propnamest	localdicttnametvaluetdeprecated_kwdsR/taxessize_fontsizetktvtreps((sD/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/legend.pyRos�N
						



	 		 		
		
		 		 	
		

	

		
cC sC|j|j�|jr,|j|j�n|j|j��dS(sE
        set the boilerplate props for artists added to axes
        N(RsRtRqRrtaxest
set_transformt
get_transform(R ta((sD/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/legend.pyR|\s	cC sG||_|dkr!|j}n	|j}|jj|�||_dS(Ni(t	_loc_realt_findoffset_bestt_findoffset_locRt
set_offset(R R�t_findoffset((sD/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/legend.pyt_set_locfs		cC s|jS(N(R�(R ((sD/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/legend.pyt_get_locwscC s-|j|||�\}}||||fS(s9Helper function to locate the legend at its best position(t_find_best_position(R R'R(txdescenttydescenttrenderertoxtoy((sD/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/legend.pyR�|scC s�t|j�rkt|j�dkrk|j\}}|j�}|j|j||j|j|}	}
n?tj	dd||�}|j
|j||j�|�\}	}
|	||
|fS(s;Heper function to locate the legend using the location codeii(RR-RgR&tx0R'ty0R(Rtfrom_boundst_get_anchored_bbox(R R'R(R�R�R�tfxtfyR/txty((sD/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/legend.pyR��s$,'cC s(|j�sdS|jd�|j|j�}|jdkrvd|j|j|}|jj|j	�j
|�n|jr|jj|�}|j
j|j|j|j
|j�|j
j|�|jr�t|j
dd�}|j|�n|j
j|�n|jj|�|jd�dS(s*Draw everything that belongs to the legendNRtexpandii����(sexpand(tget_visiblet
open_grouptpoints_to_pixelsR[RzRJRBRt	set_widthR&R'R}tget_window_extentR!t
set_boundsR�R�R(tset_mutation_scaleR?Rtdrawtclose_group(R R�tfontsizeRCR/R?((sD/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/legend.pyR��s$
 		cC s'|dkr|jS|j|j�SdS(sm
        Return the approximate height of the text. This is used to place
        the legend handle.
        N(R*R[R�(R R�((sD/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/legend.pyt_approx_text_height�sc-C sw	|j}g}g}tddddd|j�}g}g}|j�d}	d}
x�t||�D]�\}}t|t�s�t|t�r�|j}
n	|j	}
|
dkr�t
jd	||jd	||
�}|}n?|
dkrt
jd
|j|d�}d|j|g}nt|t
�rN|	|
d
t
j|jt�}t
||�}|j|�|j|�|jd)�|jd)�|jd�|jd�|j|�t
||t|� �}|j|�|j|�|jd)�|jd)�|jd�|jdkrB|j�|j}|j|�n||_n�t|t�r�t dd*d|j|d|	|
�}|j|�|j|�|jd)�|jd)�|j|�n_t|t!�r�|	|
d
t
j|jt�}t
||�}|j|�|jd)�|jd)�|j"�d
}|j#�d
}|j$�d
}|j%|�|j&|�|d
d)k	r�|j'|d�n|j|�n{t|t�r�|	|j(}t)|j*��|jdt+|j*��|jd}}|jdkr+d||||g}n$||t
jd
d|j�|}t,|�|j-�d|j.�d|dt||�d|j/��}|j|�|j0|j1�|jd)�|jd)�|j|�nKt|t�r�|	|j(}t)|j*��|jdt+|j*��|jd}}|jdkr[d||||g}n$||t
jd
d|j�|}t,|�|dt||�d|j/��}|j|�|j0|j1�|jd)�|jd)�|j|�n3t,|�}t2j3dt4|�f�|jd)�|d}|d)k	ret5|d|dt6dt6�}|j|j7�|j|�t8d|j|d|	ddd|
�}|j9|�t|t�s�t|t�r�|j/�|_:|j;d)�nt<|d�r|j9|j�n|j|�qeqeWt|�d
kr�t+|j=t|��}t>t|�|�\}} || }!t?t@d
| |d|d�|dg| �}"t?t@| |dt|�|�|g|!�}#n
gg}"}#t?||�}$g}%x�|"|#D]�\}&}'g|$|&|&|'!D]:\}(})tAd d
d!|jB|d"|(|)gd#d�^q}*|*djC�djDtE�|%jtFd d
d!|jG|d#dd"|*��qW|jHd$kr�d$}+nd%}+|jI|},tAd d
d!|,d#dd&|+d"|%�|_Jt5d'�|_KtFd |jL|d!|jG|d#d(d"|jK|jJg�|_M|jMj0|j1�||_N||_Od)S(+s�
        Initiallize the legend_box. The legend_box is an instance of
        the OffsetBox, which is packed with legend handles and
        texts. Once packed, their location is calculated during the
        drawing time.
        tverticalalignmenttbaselinethorizontalalignmenttlefttfontpropertiesgffffff�?gig333333�?iig�?g@tdefaultR*RLR'R(itrotationtsizestoffsetsttransOffsets�Legend does not support %s
Use proxy artist instead.

http://matplotlib.sourceforge.net/users/legend_guide.html#using-proxy-artist
i����t	textpropstmultilinebaselinetminimumdescentR�R�t
_legmarkerRCtseptchildrentalignR�tfixedR�tR8N(gg(PR[RXRVR�tzipRWRRRAR=RjtlinspaceRFR	tonestshapetfloattupdate_fromR|tset_clip_boxR*t
set_clip_patht
set_drawstylet
set_markertappendRgt
set_linestyleR>tget_markersizetset_markersizeR�R
RRt
get_linewidtht
get_dashest
get_colorst	set_colort
set_linewidtht
set_dashesRltmaxt	get_sizesRattypetget_numsidestget_rotationR�RsRtRcRdtstrRRpt_textRt
add_artistt_transOffsetR�thasattrRhtdivmodRtrangeRRHtget_childrentset_minimumdescentR4RRDRzR@t_legend_handle_boxR^RBRR\R](-R R�R�R�t	text_listthandle_listt
label_propt
labelboxesthandleboxesR(tdescentthandletlabtnpointstxdatatxdata_markertydatatleglinetlegline_markertnewsztptlwtdashestcolortsize_maxtsize_minR�thandle_typettextboxt	handleboxR�tnrowstnum_largecoltnum_smallcoltlargecoltsmallcolthandle_labelt	columnboxti0tdithttt	itemBoxesR�R�((sD/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/legend.pyR~�s8		
		!

















!





!$



!$







 
O
	

	c
C s�|j}g}g}g}xE|jD]:}|j�}|j�}|j|�}|j|�q%Wxs|jD]h}t|t�r�|j	�}	|j|j
�j|	��qm|j�}	|j|j�j|	��qmW|||gS(s{
        Returns list of vertices and extents covered by the plot.

        Returns a two long list.

        First element is a list of (x, y) vertices (in
        display-coordinates) covered by all the lines and line
        collections, in the legend's handles.

        Second element is a list of bounding boxes for all the patches in
        the legend's handles.
        (
Rvtlinestget_pathR�ttransform_pathR�tpatchesRWRtget_data_transformtget_bboxttransformedtget_extents(
R taxtverticestbboxesRR�tpathttransttpatht	transform((sD/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/legend.pyt_auto_legend_data�s 	 cC s|j|�dS(s$b is a boolean.  Set draw frame to bN(tset_frame_on(R tb((sD/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/legend.pyt
draw_frame�scC s�g}|jr"|j|j�n|j|j��|j|j��|j|j��|j|j��|jr�|j|j��n|S(sreturn a list of child artists(	RR�textendt	get_linestget_patchest	get_textst	get_frameR^t	get_title(R R�((sD/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/legend.pyR��s		cC s|jS(s6return the Rectangle instance used to frame the legend(R!(R ((sD/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/legend.pyR,�scC s)g|jD]}t|t�r
|^q
S(s5return a list of lines.Line2D instances in the legend(R]RWR	(R R((sD/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/legend.pyR)�scC s2tdg|jD]}t|t�r|^q�S(s.return a list of patch instances in the legendR
(RR]RWR
(R R((sD/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/legend.pyR*scC std|j�S(s1return a list of text.Text instance in the legendtText(RR\(R ((sD/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/legend.pyR+scC s@|jjj|�|r,|jjt�n|jjt�dS(sset the legend titleN(R^R�tset_texttset_visibleRpR4(R R�((sD/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/legend.pyRscC s
|jjS(s)return Text instance for the legend title(R^R�(R ((sD/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/legend.pyR-scC s
|jj�S(s!return a extent of the the legend(R!R�(R ((sD/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/legend.pyR�scC s|jS(s;
        Get whether the legend box patch is drawn
        (R}(R ((sD/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/legend.pytget_frame_onscC s
||_dS(sb
        Set whether the legend box patch is drawn

        ACCEPTS: [ *True* | *False* ]
        N(R}(R R&((sD/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/legend.pyR% scC s$|jdkr|jjS|jSdS(sB
        return the bbox that the legend will be anchored
        N(t_bbox_to_anchorR*RvR/(R ((sD/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/legend.pyR&(s
cC s�|dkrd|_dSt|t�r4||_nuyt|�}Wn'tk
rmtdt|���nX|dkr�|d|dddg}ntj	|�|_|dkr�t
|jj�}nt
|j|�|_dS(s>
        set the bbox that the legend will be anchored.

        *bbox* can be a BboxBase instance, a tuple of [left, bottom,
        width, height] in the given transform (normalized axes
        coordinate if None), or a tuple of [left, bottom] where the
        width and height will be assumed to be zero.
        NsInvalid argument for bbox : %siii(R*R2RWRRgRuRiR�RR�RRvR/R(R R/R#tl((sD/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/legend.pyR)2s 		
	cC s�td�\}}}}}	}
}}}
}}i
d|6d|6d|6d|	6d|
6d|6d|6d|
6d	|6d
|6}||}|j|j�}|j|j|�}|j|d|�}|j|jfS(s�
        Place the *bbox* inside the *parentbbox* according to a given
        location code. Return the (x,y) coordinate of the bbox.

        - loc: a location code in range(1, 11).
          This corresponds to the possible values for self._loc, excluding "best".

        - bbox: bbox to be placed, display coodinate units.
        - parentbbox: a parent box which will contain the bbox. In
            display coordinates.
        itNEtNWtSWtSEtEtWtStNtCt	container(R�R�R[tpaddedRJtanchoredR�R�(R R�R/t
parentbboxR�tBESTtURtULtLLtLRtRtCLtCRtLCtUCR<tanchor_coefstcR�R=tanchored_box((sD/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/legend.pyR�Ss -


cC s�|j�\}}}tjdd||�}gtdt|j��D]$}	|j|	||j�|�^qF}g}
x�|D]�\}}tj||||�}
d}|
j|�}||
j	|�7}x*|D]"}|j
|
�r�|d7}q�q�W||}}|dkr||fS|
j|||ff�q}W|
d}x+|
D]#}|d|dkrG|}qGqGW|d\}}||fS(s�
        Determine the best location to place the legend.

        `consider` is a list of (x, y) pairs to consider as a potential
        lower-left corner of the legend. All are display coords.
        ii(R$RR�R�RgRwR�R&tcount_containstcount_overlapstintersects_bboxR�(R R'R(R�tconsidertvertsRRR/R�t
candidatesR3R&t	legendBoxtbadnesstlineR�R�tminCandidatet	candidate((sD/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/legend.pyR�vs.
@





cC s�|jdk	}|dkr%|}n|rR|jdkrzt||�|_qzn(|jdk	rq|jj�nd|_|jS(s[
        Set the draggable state -- if state is

          * None : toggle the current state

          * True : turn draggable on

          * False : turn draggable off

        If draggable is on, you can drag the legend on the canvas with
        the mouse.  The DraggableLegend helper instance is returned if
        draggable is on.
        N(R�R*Rt
disconnect(R tstateRtis_draggable((sD/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/legend.pyt	draggable�s
	(&R2R3t__doc__RwtzorderR9R*RpRR|R�R�tpropertyR-R�R�RR�R�R~R$R'R�R,R)R*R+RR-R�R1R%R&R)R�R�R4R\(((sD/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/legend.pyR5As�

	�	
				$	�	(													
!	#0(+R]t
__future__RRctnumpyRjt
matplotlibRtmatplotlib.artistRRtmatplotlib.cbookRRRRtmatplotlib.font_managerRtmatplotlib.linesR	tmatplotlib.patchesR
RRR
tmatplotlib.collectionsRRRtmatplotlib.transformsRRRRRtmatplotlib.offsetboxRRRRRRR5(((sD/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/legend.pyt<module>s""((