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/legend_handler.pyo
�
r`]c@sVdZddlZddlmZddlmZddljZ	d�Z
defd��YZdefd	��YZ
d
e
fd��YZde
fd
��YZdefd��YZdefd��YZdefd��YZdefd��YZdefd��YZdefd��YZdefd��YZdefd��YZdS(sZ
This module defines default legend handlers.

Legend handlers are expected to be a callable object with a following
signature. ::

    legend_handler(legend, orig_handle, fontsize, handlebox)

Where *legend* is the legend itself, *orig_handle* is the original
plot, *fontsize* is the fontsize in pixles, and *handlebox* is a
OffsetBox instance. Within the call, you should create relevant
artists (using relevant properties from the *legend* and/or
*orig_handle*) and add them into the handlebox. The artists needs to
be scaled according to the fontsize (note that the size is in pixel,
i.e., this is dpi-scaled value).

This module includes definition of several legend handler classes
derived from the base class (HandlerBase) with a following method.

    def __call__(self, legend, orig_handle,
                 fontsize,
                 handlebox):


i����N(tLine2D(t	RectanglecCs|j|j�d�dS(Ni(tupdate_fromtget_children(ttgttsrc((s?/usr/lib64/python2.7/site-packages/matplotlib/legend_handler.pytupdate_from_first_child"stHandlerBasecBsVeZdZddd	d�Zd�Zd�Zd�Zd�Zd�Z	d�Z
RS(
s
    A Base class for default legend handlers.

    The derived classes are meant to override *create_artists* method, which
    has a following signature.::

      def create_artists(self, legend, orig_handle,
                         xdescent, ydescent, width, height, fontsize,
                         trans):

    The overridden method needs to create artists of the given
    transform that fits in the given dimension (xdescent, ydescent,
    width, height) that are scaled by fontsize if necessary.

    gcCs |||_|_||_dS(N(t_xpadt_ypadt_update_prop_func(tselftxpadtypadtupdate_func((s?/usr/lib64/python2.7/site-packages/matplotlib/legend_handler.pyt__init__6scCs6|jdkr"|j||�n|j||�dS(N(R
tNonet_default_update_prop(Rt
legend_handletorig_handle((s?/usr/lib64/python2.7/site-packages/matplotlib/legend_handler.pyt_update_prop:scCs|j|�dS(N(R(RRR((s?/usr/lib64/python2.7/site-packages/matplotlib/legend_handler.pyR@scCs;|j||�|j|�|jd�|jd�dS(N(Rt_set_artist_propstset_clip_boxRt
set_clip_path(RRRtlegend((s?/usr/lib64/python2.7/site-packages/matplotlib/legend_handler.pytupdate_propCs

cCsT||j|}||j|}||j|}||j|}||||fS(N(RR	(RRRtxdescenttydescenttwidththeighttfontsize((s?/usr/lib64/python2.7/site-packages/matplotlib/legend_handler.pytadjust_drawing_areaKs
c	Cs�|j|j|j|jf\}}}}|j|||||||�\}}}}|j||||||||j��}	x|	D]}
|j|
�q�W|	dS(sa
        x, y, w, h in display coordinate w/ default dpi (72)
        fontsize in points
        i(RRRRRtcreate_artistst
get_transformt
add_artist(RRRRt	handleboxRRRRta_listta((s?/usr/lib64/python2.7/site-packages/matplotlib/legend_handler.pyt__call__Ts
c		Cstd��dS(NsDerived must override(tNotImplementedError(	RRRRRRRRttrans((s?/usr/lib64/python2.7/site-packages/matplotlib/legend_handler.pyR psN(t__name__t
__module__t__doc__RRRRRRR&R (((s?/usr/lib64/python2.7/site-packages/matplotlib/legend_handler.pyR&s						tHandlerNpointscBs)eZddd�Zd�Zd�ZRS(g333333�?cKs&tj||�||_||_dS(N(RRt
_numpointst_marker_pad(Rt
marker_padt	numpointstkw((s?/usr/lib64/python2.7/site-packages/matplotlib/legend_handler.pyRxs	cCs!|jdkr|jS|jSdS(N(R-RR0(RR((s?/usr/lib64/python2.7/site-packages/matplotlib/legend_handler.pyt
get_numpoints~sc
Cs�|j|�}|dkrPtj||j|||j||�}|}	n:|dkr�tj||d�}d|d|g}	n||	fS(Niig�?(R2tnptlinspaceR.(
RRRRRRRR0txdatatxdata_marker((s?/usr/lib64/python2.7/site-packages/matplotlib/legend_handler.pyt	get_xdata�s		N(R)R*RRR2R7(((s?/usr/lib64/python2.7/site-packages/matplotlib/legend_handler.pyR,ws	tHandlerNpointsYoffsetscBs eZddd�Zd�ZRS(cKs#tj|d||�||_dS(NR0(R,Rt	_yoffsets(RR0tyoffsetsR1((s?/usr/lib64/python2.7/site-packages/matplotlib/legend_handler.pyR�scCs9|jdkr||j}n|tj|j�}|S(N(R9Rt_scatteryoffsetsR3tasarray(RRRRRRRtydata((s?/usr/lib64/python2.7/site-packages/matplotlib/legend_handler.pyt	get_ydata�sN(R)R*RRR>(((s?/usr/lib64/python2.7/site-packages/matplotlib/legend_handler.pyR8�st
HandlerLine2DcBs&eZdZddd�Zd�ZRS(s&
    Handler for Line2D instances
    g333333�?cKs tj|d|d||�dS(NR/R0(R,R(RR/R0R1((s?/usr/lib64/python2.7/site-packages/matplotlib/legend_handler.pyR�sc	Cs|j||||||�\}	}
||dtj|	jt�}t|	|�}|j|||�|jd�|jd�t|
|t	|
� �}
|j|
||�|
j
d�|jdkr�|
j�|j}|
j
|�n|
|_|j|�|
j|�||
gS(Ng@tdefaulttRi(R7R3tonestshapetfloatRRt
set_drawstylet
set_markertlent
set_linestyletmarkerscaletget_markersizetset_markersizet
_legmarkert
set_transform(RRRRRRRRR(R5R6R=tleglinetlegline_markertnewsz((s?/usr/lib64/python2.7/site-packages/matplotlib/legend_handler.pyR �s"!


	

N(R)R*R+RRR (((s?/usr/lib64/python2.7/site-packages/matplotlib/legend_handler.pyR?�stHandlerPatchcBs,eZdZdd�Zd�Zd�ZRS(s
    Handler for Patches
    cKstj||�||_dS(N(RRt_patch_func(Rt
patch_funcR1((s?/usr/lib64/python2.7/site-packages/matplotlib/legend_handler.pyR�sc	Cso|jdkr5td||fd|d|�}n6|jd|d|d|d|d|d|d|�}|S(	NtxyRRRRRRR(RRRR(	RRRRRRRRtp((s?/usr/lib64/python2.7/site-packages/matplotlib/legend_handler.pyt
_create_patch�sc	
CsH|j|||||||�}	|j|	||�|	j|�|	gS(N(RVRRM(
RRRRRRRRR(RU((s?/usr/lib64/python2.7/site-packages/matplotlib/legend_handler.pyR �s

N(R)R*R+RRRVR (((s?/usr/lib64/python2.7/site-packages/matplotlib/legend_handler.pyRQ�s	tHandlerLineCollectioncBs)eZdZd�Zd�Zd�ZRS(s%
    Handler for LineCollections
    cCs!|jdkr|jS|jSdS(N(R-Rt
scatterpoints(RR((s?/usr/lib64/python2.7/site-packages/matplotlib/legend_handler.pyR2�scCsr|j�d}|j�d}|j�d}|j|�|j|�|ddk	rn|j|d�ndS(Nii(t
get_linewidtht
get_dashest
get_colorst	set_colort
set_linewidthRt
set_dashes(RRRtlwtdashestcolor((s?/usr/lib64/python2.7/site-packages/matplotlib/legend_handler.pyR�s

c	
Cs{|j||||||�\}	}
||dtj|	jt�}t|	|�}|j|||�|j|�|gS(Ng@(R7R3RBRCRDRRRM(
RRRRRRRRR(R5R6R=RN((s?/usr/lib64/python2.7/site-packages/matplotlib/legend_handler.pyR �s!
(R)R*R+R2RR (((s?/usr/lib64/python2.7/site-packages/matplotlib/legend_handler.pyRW�s			tHandlerRegularPolyCollectioncBsJeZdZddd�Zd�Zd�Zd�Zd�Zd�Z	RS(s-
    Handler for RegularPolyCollections.
    cKs#tj|d||�||_dS(NR:(R8Rt_sizes(RR:tsizesR1((s?/usr/lib64/python2.7/site-packages/matplotlib/legend_handler.pyRscCs!|jdkr|jS|jSdS(N(R-RRX(RR((s?/usr/lib64/python2.7/site-packages/matplotlib/legend_handler.pyR2sc
Cs�|jdkr�t|j��|jd}t|j��|jd}	|j|�}
|
dkr~d||	||	g}q�||	}|tjdd|
�|	}n	|j}|S(Niig�?ii(	RcRtmaxt	get_sizesRItminR2R3R4(
RRRRRRRRtsize_maxtsize_minR0Rdtrng((s?/usr/lib64/python2.7/site-packages/matplotlib/legend_handler.pyRfs
 	cCs>|j||�|j|j�|jd�|jd�dS(N(Rt
set_figuretfigureRRR(RRRR((s?/usr/lib64/python2.7/site-packages/matplotlib/legend_handler.pyR)s
c
Cs:t|�|j�d|j�d|d|d|�}|S(NtrotationRdtoffsetsttransOffset(ttypetget_numsidestget_rotation(RRRdRnRoRU((s?/usr/lib64/python2.7/site-packages/matplotlib/legend_handler.pytcreate_collection2s	c	Cs�|j||||||�\}	}
|j||||||�}|j|||||||�}|j||dt|
|�d|�}
|j|
||�||
_|
gS(NRnRo(R7R>RfRstzipRt_transOffset(RRRRRRRRR(R5R6R=RdRU((s?/usr/lib64/python2.7/site-packages/matplotlib/legend_handler.pyR ;s		N(
R)R*R+RRR2RfRRsR (((s?/usr/lib64/python2.7/site-packages/matplotlib/legend_handler.pyRbs						tHandlerPathCollectioncBseZdZd�ZRS(s@
    Handler for PathCollections, which are used by scatter
    cCs5t|�|j�dgd|d|d|�}|S(NiRdRnRo(Rpt	get_paths(RRRdRnRoRU((s?/usr/lib64/python2.7/site-packages/matplotlib/legend_handler.pyRsTs
	(R)R*R+Rs(((s?/usr/lib64/python2.7/site-packages/matplotlib/legend_handler.pyRvPstHandlerCircleCollectioncBseZdZd�ZRS(s'
    Handler for CircleCollections
    cCs"t|�|d|d|�}|S(NRnRo(Rp(RRRdRnRoRU((s?/usr/lib64/python2.7/site-packages/matplotlib/legend_handler.pyRsas	(R)R*R+Rs(((s?/usr/lib64/python2.7/site-packages/matplotlib/legend_handler.pyRx]stHandlerErrorbarcBs5eZdZddddd�Zd�Zd�ZRS(s
    Handler for Errorbars
    g�?g333333�?cKs2||_||_tj|d|d||�dS(NR/R0(t
_xerr_sizet
_yerr_sizeR?R(Rt	xerr_sizet	yerr_sizeR/R0R1((s?/usr/lib64/python2.7/site-packages/matplotlib/legend_handler.pyRms		c	Cs<|j|}|jdkr%|}n
|j|}||fS(N(RzR{R(	RRRRRRRR|R}((s?/usr/lib64/python2.7/site-packages/matplotlib/legend_handler.pytget_err_sizevs

	
c	Cs�|\}	}
}|j||||||�\}}
||dtj|jt�}t||�}tj|
�}
tj|t|
� �}|j||||||�\}}t|
|�}|	dkr�|j
t�|j
t�n|j||	|�|j
d�|jd�|j||	|�|jd�|jdkrf|j�|j}|j|�ng}g}|jr�gt|
|�D],\}}|||f|||ff^q�}tj|�}|j||d|�|j|�|
r�t|
||�}t|
||�}|j||
d|�|j||
d|�|jd�|jd�|j|�|j|�q�n|jr�gt|
|�D],\}}|||f|||ff^q�}tj|�}|j||d|�|j|�|
r�t|
||�}t|
||�}|j||
d|�|j||
d|�|jd�|jd�|j|�|j|�q�ng}|j|�|j|�|j|�|j|�x|D]}|j|�q�W|S(Ng@R@Riit|t_(R7R3RBRCRDRR<RGR~Rtset_visibletFalseRRERFRHRIRJRKthas_xerrRttmcolltLineCollectiontappendthas_yerrtextendRM(RRRRRRRRR(t	plotlinestcaplinestbarlinecolsR5R6R=RNtydata_markerR|R}RORPthandle_barlinecolsthandle_caplinestxtytvertstcolltcapline_leftt
capline_righttartiststartist((s?/usr/lib64/python2.7/site-packages/matplotlib/legend_handler.pyR �sz!



	?



	?








N(R)R*R+RRR~R (((s?/usr/lib64/python2.7/site-packages/matplotlib/legend_handler.pyRyis
	
tHandlerStemcBs5eZdZddddd�Zd�Zd�ZRS(s
    Handler for Errorbars
    g333333�?c	Ks/tj|d|d|d||�||_dS(NR/R0R:(R8Rt_bottom(RR/R0tbottomR:R1((s?/usr/lib64/python2.7/site-packages/matplotlib/legend_handler.pyR�s
cCsA|jdkr'|d|jd}n|tj|j�}|S(Ng�?(R9RR;R3R<(RRRRRRRR=((s?/usr/lib64/python2.7/site-packages/matplotlib/legend_handler.pyR>�sc	Cs�|\}	}
}|j||||||�\}}
|j||||||�}|jdkrid}n	|j}t|
|t|
� �}|j||	|�g}xEt|
|�D]4\}}t||g||g�}|j|�q�Wx0t||
�D]\}}|j|||�q�Wtt	j
|�t	j|�g||g�}|j|||�|g}|j|�|j|�x|D]}|j
|�q�W|S(Ng(R7R>R�RRRGRRtR�R3tamintamaxR�RM(RRRRRRRRR(t
markerlinet	stemlinestbaselineR5R6R=R�tleg_markerlinet
leg_stemlinestthisxtthisytltlmtmtleg_baselineR�R�((s?/usr/lib64/python2.7/site-packages/matplotlib/legend_handler.pyR �s2			


N(R)R*R+RRR>R (((s?/usr/lib64/python2.7/site-packages/matplotlib/legend_handler.pyR��s
	tHandlerTuplecBs eZdZd�Zd�ZRS(s
    Handler for Tuple
    cKstj||�dS(N(RR(Rtkwargs((s?/usr/lib64/python2.7/site-packages/matplotlib/legend_handler.pyRsc	
Csj|j�}	g}
xQ|D]I}|j|	|�}|j||||||||�}
|
j|
�qW|
S(N(tget_legend_handler_maptget_legend_handlerR R�(RRRRRRRRR(thandler_mapR$thandle1thandlert_a_list((s?/usr/lib64/python2.7/site-packages/matplotlib/legend_handler.pyR  s
	(R)R*R+RR (((s?/usr/lib64/python2.7/site-packages/matplotlib/legend_handler.pyR�s	(R+tnumpyR3tmatplotlib.linesRtmatplotlib.patchesRtmatplotlib.collectionstcollectionsR�RtobjectRR,R8R?RQRWRbRvRxRyR�R�(((s?/usr/lib64/python2.7/site-packages/matplotlib/legend_handler.pyt<module>s"	Q%!H
p@

Anon7 - 2021