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/widgets.pyo
�
r`]c@s�dZddlmZddlZddlmZddlmZm	Z	ddl
mZddlm
Z
dfd	��YZd
efd��YZdefd
��YZdefd��YZdefd��YZdefd��YZdefd��YZdefd��YZdefd��YZdefd��YZdefd��YZdefd��YZd efd!��YZd"efd#��YZd$efd%��YZdS(&s�
GUI Neutral widgets
===================

Widgets that are designed to work for any of the GUI backends.
All of these widgets require you to predefine an :class:`matplotlib.axes.Axes`
instance and pass that as the first arg.  matplotlib doesn't try to
be too smart with respect to layout -- you will have to figure out how
wide and tall you want your Axes to be to accommodate your widget.
i����(tprint_functionN(tdist(tCirclet	Rectangle(tLine2D(tblended_transform_factorytLockDrawcBsDeZdZd�Zd�Zd�Zd�Zd�Zd�ZRS(sY
    Some widgets, like the cursor, draw onto the canvas, and this is not
    desirable under all circumstances, like when the toolbar is in
    zoom-to-rect mode and drawing a rectangle.  The module level "lock"
    allows someone to grab the lock and prevent other widgets from
    drawing.  Use ``matplotlib.widgets.lock(someobj)`` to pr
    cCs
d|_dS(N(tNonet_owner(tself((s8/usr/lib64/python2.7/site-packages/matplotlib/widgets.pyt__init__scCs+|j|�std��n||_dS(sreserve the lock for *o*salready lockedN(t	availablet
ValueErrorR(R	to((s8/usr/lib64/python2.7/site-packages/matplotlib/widgets.pyt__call__!scCs+|j|�std��nd|_dS(srelease the locksyou do not own this lockN(RRRR(R	R
((s8/usr/lib64/python2.7/site-packages/matplotlib/widgets.pytrelease'scCs|j�p|j|�S(sdrawing is available to *o*(tlockedtisowner(R	R
((s8/usr/lib64/python2.7/site-packages/matplotlib/widgets.pyR-scCs
|j|kS(s!Return True if *o* owns this lock(R(R	R
((s8/usr/lib64/python2.7/site-packages/matplotlib/widgets.pyR1scCs
|jdk	S(s5Return True if the lock is currently held by an ownerN(RR(R	((s8/usr/lib64/python2.7/site-packages/matplotlib/widgets.pyR5s(	t__name__t
__module__t__doc__R
RRRRR(((s8/usr/lib64/python2.7/site-packages/matplotlib/widgets.pyRs					tWidgetcBseZdZeZeZRS(s5
    Abstract base class for GUI neutral widgets
    (RRRtTruetdrawonteventson(((s8/usr/lib64/python2.7/site-packages/matplotlib/widgets.pyR:st
AxesWidgetcBs2eZdZd�Zd�Zd�Zd�ZRS(svWidget that is connected to a single :class:`~matplotlib.axes.Axes`.

    Attributes:

    *ax* : :class:`~matplotlib.axes.Axes`
        The parent axes for the widget
    *canvas* : :class:`~matplotlib.backend_bases.FigureCanvasBase` subclass
        The parent figure canvas for the widget.
    *active* : bool
        If False, the widget does not respond to events.
    cCs.||_|jj|_g|_t|_dS(N(taxtfiguretcanvastcidsRtactive(R	R((s8/usr/lib64/python2.7/site-packages/matplotlib/widgets.pyR
Ns		cCs)|jj||�}|jj|�dS(s�Connect callback with an event.

        This should be used in lieu of `figure.canvas.mpl_connect` since this
        function stores call back ids for later clean up.
        N(Rtmpl_connectRtappend(R	teventtcallbacktcid((s8/usr/lib64/python2.7/site-packages/matplotlib/widgets.pyt
connect_eventTscCs(x!|jD]}|jj|�q
WdS(s-Disconnect all events created by this widget.N(RRtmpl_disconnect(R	tc((s8/usr/lib64/python2.7/site-packages/matplotlib/widgets.pytdisconnect_events]scCs|jS(s�Return True if event should be ignored.

        This method (or a version of it) should be called at the beginning
        of any event callback.
        (R(R	R!((s8/usr/lib64/python2.7/site-packages/matplotlib/widgets.pytignorebs(RRRR
R$R'R((((s8/usr/lib64/python2.7/site-packages/matplotlib/widgets.pyRBs
				tButtoncBsMeZdZd	ddd�Zd�Zd�Zd�Zd�Zd�Z	RS(
s�
    A GUI neutral button

    The following attributes are accessible

      *ax*
        The :class:`matplotlib.axes.Axes` the button renders into.

      *label*
        A :class:`matplotlib.text.Text` instance.

      *color*
        The color of the button when not hovering.

      *hovercolor*
        The color of the button when hovering.

    Call :meth:`on_clicked` to connect to the button
    s0.85s0.95c
Cs�tj||�|d
k	r,|j|�n|jdd|ddddd|j�|_d|_i|_|j	d|j
�|j	d|j�|j	d	|j�|j
t�|j|�|jg�|jg�||_||_||_d
S(s
        *ax*
            The :class:`matplotlib.axes.Axes` instance the button
            will be placed into.

        *label*
            The button text. Accepts string.

        *image*
            The image to place in the button, if not *None*.
            Can be any legal arg to imshow (numpy array,
            matplotlib Image instance, or PIL image).

        *color*
            The color of the button when not activated

        *hovercolor*
            The color of the button when the mouse is over it
        g�?tverticalalignmenttcenterthorizontalalignmentt	transformitbutton_press_eventtbutton_release_eventtmotion_notify_eventN(RR
Rtimshowttextt	transAxestlabeltcntt	observersR$t_clickt_releaset_motiontset_navigatetFalsetset_axis_bgcolort
set_xtickst
set_ytickstcolort
hovercolort
_lastcolor(R	RR4timageR?R@((s8/usr/lib64/python2.7/site-packages/matplotlib/widgets.pyR
�s&		



		cCse|j|�rdS|j|jkr)dS|js6dS|jj|jkra|jj|j�ndS(N(R(tinaxesRRRt
mouse_grabbert
grab_mouse(R	R!((s8/usr/lib64/python2.7/site-packages/matplotlib/widgets.pyR7�s	cCs�|j|�rdS|jj|jkr,dS|jj|j�|jsLdS|j|jkrbdSx'|jj�D]\}}||�qrWdS(N(	R(RRDRt
release_mouseRRCR6t	iteritems(R	R!R#tfunc((s8/usr/lib64/python2.7/site-packages/matplotlib/widgets.pyR8�s	cCs�|j|�rdS|j|jkr1|j}n	|j}||jkr�|jj|�||_|jr�|jjj	j
�q�ndS(N(R(RCRR@R?RAR<RRRtdraw(R	R!R&((s8/usr/lib64/python2.7/site-packages/matplotlib/widgets.pyR9�s			cCs)|j}||j|<|jd7_|S(s�
        When the button is clicked, call this *func* with event

        A connection id is returned which can be used to disconnect
        i(R5R6(R	RHR#((s8/usr/lib64/python2.7/site-packages/matplotlib/widgets.pyt
on_clicked�s	
cCs&y|j|=Wntk
r!nXdS(s,remove the observer with connection id *cid*N(R6tKeyError(R	R#((s8/usr/lib64/python2.7/site-packages/matplotlib/widgets.pyt
disconnect�s
N(
RRRRR
R7R8R9RJRL(((s8/usr/lib64/python2.7/site-packages/matplotlib/widgets.pyR)ks,	
	
		tSlidercBsYeZdZddeed	d	ed�Zd�Zd�Zd�Zd�Z	d�Z
RS(
sX
    A slider representing a floating point range

    The following attributes are defined
      *ax*        : the slider :class:`matplotlib.axes.Axes` instance

      *val*       : the current slider value

      *vline*     : a :class:`matplotlib.lines.Line2D` instance
                     representing the initial value of the slider

      *poly*      : A :class:`matplotlib.patches.Polygon` instance
                     which is the slider knob

      *valfmt*    : the format string for formatting the slider text

      *label*     : a :class:`matplotlib.text.Text` instance
                     for the slider label

      *closedmin* : whether the slider is closed on the minimum

      *closedmax* : whether the slider is closed on the maximum

      *slidermin* : another slider - if not *None*, this slider must be
                     greater than *slidermin*

      *slidermax* : another slider - if not *None*, this slider must be
                     less than *slidermax*

      *dragging*  : allow for mouse dragging on slider

    Call :meth:`on_changed` to connect to the slider event
    g�?s%1.2fc

Ks�tj||�||_||_||_||_|j||dd|�|_|j|dddddd�|_	||_
|jg�|j||f�|j
g�|jt�|jd|j�|jd|j�|r�|jd|j�n|jd	d
|d|jdd
dd�|_|jdd
||d|jdd
dd�|_d|_i|_||_||_|	|_|
|_t|_dS(s�
        Create a slider from *valmin* to *valmax* in axes *ax*

        *valinit*
            The slider initial position

        *label*
            The slider label

        *valfmt*
            Used to format the slider value

        *closedmin* and *closedmax*
            Indicate whether the slider interval is closed

        *slidermin* and *slidermax*
            Used to constrain the value of this slider to the values
            of other sliders.

        additional kwargs are passed on to ``self.poly`` which is the
        :class:`matplotlib.patches.Rectangle` which draws the slider
        knob.  See the :class:`matplotlib.patches.Rectangle` documentation
        valid property names (e.g., *facecolor*, *edgecolor*, *alpha*, ...)
        iiR?trtlwR.R/R0g{�G�z��g�?R-R*R+R,trightgR���Q�?tleftN(RR
tvalmintvalmaxtvaltvalinittaxvspantpolytaxvlinetvlinetvalfmtR>tset_xlimR=R:R;R$t_updateR2R3R4tvaltextR5R6t	closedmint	closedmaxt	slidermint	slidermaxtdrag_active(
R	RR4RRRSRURZR^R_R`Ratdraggingtkwargs((s8/usr/lib64/python2.7/site-packages/matplotlib/widgets.pyR
s<				$	


							cCs�|j|�rdS|jdkr&dS|jdkrf|j|jkrft|_|jj|j�n|jssdS|jdks�|jdkr�|j|jkr�t	|_|jj
|j�dS|j}||jkr�|j
s�dS|j}n(||jkr|jsdS|j}n|jdk	rY||jjkrY|j
sJdS|jj}n|jdk	r�||jjkr�|js�dS|jj}n|j|�dS(supdate the slider positionNiR.R/(R(tbuttontnameRCRRRbRRER;RFtxdataRRR^RSR_R`RRTRatset_val(R	R!RT((s8/usr/lib64/python2.7/site-packages/matplotlib/widgets.pyR\Fs@!		!				!	!	cCs�|jj}|df|d<|df|d<||j_|jj|j|�|jrn|jjjj	�n||_
|js�dSx'|jj
�D]\}}||�q�WdS(Niiii(RWtxyR]tset_textRZRRRRRIRTRR6RG(R	RTRiR#RH((s8/usr/lib64/python2.7/site-packages/matplotlib/widgets.pyRhqs			cCs)|j}||j|<|jd7_|S(s�
        When the slider value is changed, call *func* with the new
        slider position

        A connection id is returned which can be used to disconnect
        i(R5R6(R	RHR#((s8/usr/lib64/python2.7/site-packages/matplotlib/widgets.pyt
on_changed}s	
cCs&y|j|=Wntk
r!nXdS(s,remove the observer with connection id *cid*N(R6RK(R	R#((s8/usr/lib64/python2.7/site-packages/matplotlib/widgets.pyRL�s
cCs)|j|jkr%|j|j�ndS(s/reset the slider to the initial value if neededN(RTRURh(R	((s8/usr/lib64/python2.7/site-packages/matplotlib/widgets.pytreset�sN(RRRRRR
R\RhRkRLRl(((s8/usr/lib64/python2.7/site-packages/matplotlib/widgets.pyRM�s!@	+			tCheckButtonscBs2eZdZd�Zd�Zd�Zd�ZRS(sN
    A GUI neutral radio button

    The following attributes are exposed

     *ax*
        The :class:`matplotlib.axes.Axes` instance the buttons are
        located in

     *labels*
        List of :class:`matplotlib.text.Text` instances

     *lines*
        List of (line1, line2) tuples for the x's in the check boxes.
        These lines exist for each box, but have ``set_visible(False)``
        when its box is not checked.

     *rectangles*
        List of :class:`matplotlib.patches.Rectangle` instances

    Connect to the CheckButtons with the :meth:`on_clicked` method
    cCs�tj||�|jg�|jg�|jt�t|�dkrdt|�d}tjd||t|��}nd}dg}d}|j	�}g|_
g|_g|_idd6dd	6|j
d
6dd6}xvt||�D]e\}	}
|jd|	|
d
|j
d
ddd�}|d|d}}
d|	|
d}}	td||	fd|d|
d|d
|j
�}t|||g|	|
|	g|�}t|||g|	|	|
g|�}|j||�|j||�|j
j|�|jj|�|jj||f�|j|�|j|�|j|�|d7}q�W|jd|j�d|_i|_dS(s

        Add check buttons to :class:`matplotlib.axes.Axes` instance *ax*

        *labels*
            A len(buttons) list of labels as strings

        *actives*
            A len(buttons) list of booleans indicating whether
             the button is active
        ig�?g�?g�?itkR?g�?t	linewidthR-tbutttsolid_capstyleR,RQR*R+g@g�������?Ritwidththeightt	facecolorR.N(RR
R=R>R:R;tlentnptlinspacetget_axis_bgcolortlabelstlinest
rectanglesR3tzipR2RRtset_visibleR t	add_patchtadd_lineR$t_clickedR5R6(R	RRytactivestdytysR5taxcolort
lineparamstyR4tttwthtxtptl1tl2((s8/usr/lib64/python2.7/site-packages/matplotlib/widgets.pyR
�sN


"				
	&&


	c
CsI|j|�rdS|jdkr&dS|j|jkr<dSx�t|j|j|j�D]�\}}}|j�j	|j
|j�s�|j�j	|j
|j�rX|\}}|j|j
��|j|j
��|}PqXqXWdS|jr|jjjj�n|jsdSx-|jj�D]\}}	|	|j��q%WdS(Ni(R(ReRCRR|R{RyRztget_window_extenttcontainsR�R�R}tget_visibleRRRRIRR6RGtget_text(
R	R!R�R�RzR�R�tthistR#RH((s8/usr/lib64/python2.7/site-packages/matplotlib/widgets.pyR��s*+		cCs)|j}||j|<|jd7_|S(s�
        When the button is clicked, call *func* with button label

        A connection id is returned which can be used to disconnect
        i(R5R6(R	RHR#((s8/usr/lib64/python2.7/site-packages/matplotlib/widgets.pyRJs	
cCs&y|j|=Wntk
r!nXdS(s,remove the observer with connection id *cid*N(R6RK(R	R#((s8/usr/lib64/python2.7/site-packages/matplotlib/widgets.pyRLs
(RRRR
R�RJRL(((s8/usr/lib64/python2.7/site-packages/matplotlib/widgets.pyRm�s
	@		tRadioButtonscBs8eZdZddd�Zd�Zd�Zd�ZRS(s�
    A GUI neutral radio button

    The following attributes are exposed

     *ax*
        The :class:`matplotlib.axes.Axes` instance the buttons are in

     *activecolor*
        The color of the button when clicked

     *labels*
        A list of :class:`matplotlib.text.Text` instances

     *circles*
        A list of :class:`matplotlib.patches.Circle` instances

    Connect to the RadioButtons with the :meth:`on_clicked` method
    itbluecCs�tj||�||_|jg�|jg�|jt�dt|�d}tj	d||t|��}d}|j
�}g|_g|_x�t
||�D]�\}	}
|jd|	|
d|jdddd	�}||kr�|}n|}td
d|	fdd
d|d|j�}
|jj|�|jj|
�|j|
�|d7}q�W|jd|j�d|_i|_dS(s3
        Add radio buttons to :class:`matplotlib.axes.Axes` instance *ax*

        *labels*
            A len(buttons) list of labels as strings

        *active*
            The index into labels for the button that is active

        *activecolor*
            The color of the button when clicked
        g�?iig�?R-R,RQR*R+Rig333333�?tradiusg�������?RtR.N(RR
tactivecolorR=R>R:R;RuRvRwRxRytcirclesR|R2R3RR R~R$R�R5R6(R	RRyRR�R�R�R5R�R�R4R�RtR�((s8/usr/lib64/python2.7/site-packages/matplotlib/widgets.pyR
*s6
	


				
	cs�|j|�rdS|jdkr&dS|j|jkr<dS|jjj�j|j|jf�}t	j
|d|dg���fd�}xat|j|j
�D]F\}}|j�j|j|j�s�||�r�|}|}Pq�q�WdSxE|jD]:}||kr|j}n|jj�}|j|�q�W|jrZ|jjjj�n|jsgdSx-|jj�D]\}	}
|
|j��qwWdS(Niics9tj|jd|jdg�}t�|�|jkS(Nii(RvtarrayR+RR�(R�tpcirc(tpclicked(s8/usr/lib64/python2.7/site-packages/matplotlib/widgets.pytinsideds#(R(ReRCRR3tinvertedttransform_pointR�R�RvR�R|R�RyR�R�R�Rxt
set_facecolorRRRRIRR6RGR�(R	R!RiR�R�R�tinpR�R?R#RH((R�s8/usr/lib64/python2.7/site-packages/matplotlib/widgets.pyR�]s4'"*		cCs)|j}||j|<|jd7_|S(s�
        When the button is clicked, call *func* with button label

        A connection id is returned which can be used to disconnect
        i(R5R6(R	RHR#((s8/usr/lib64/python2.7/site-packages/matplotlib/widgets.pyRJ}s	
cCs&y|j|=Wntk
r!nXdS(s,remove the observer with connection id *cid*N(R6RK(R	R#((s8/usr/lib64/python2.7/site-packages/matplotlib/widgets.pyRL�s
(RRRR
R�RJRL(((s8/usr/lib64/python2.7/site-packages/matplotlib/widgets.pyR�s
3	 	tSubplotToolcBsMeZdZd�Zd�Zd�Zd�Zd�Zd�Zd�Z	RS(sS
    A tool to adjust to subplot params of a :class:`matplotlib.figure.Figure`
    cs\|�_�jdddd�ddd��Y}�jd��_�jjd��jjt�t�jdd	d
|jj	dt��_
�j
j�j��jd��_
�j
jt�t�j
d
d	d
|jjdt��_�jj�j��jd��_�jjt�t�jdd	d
|jjdt��_�jj�j��jd��_�jjt�t�jdd	d
|jjdt��_�jj�j��jd��_�jjt�t�jdd	d
|jjdt��_�jj�j��jd��_�jjt�t�jdd	d
|jjdt��_�jj�j ��j�j
_!�j
�j_"�j�j_!�j�j_"�j#ddddg�}t$|d��_%�j
�j�j�j�j�jf����fd�}�jj&}t�j_&�j%j'|�|�j_&dS(s
        *targetfig*
            The figure instance to adjust

        *toolfig*
            The figure instance to embed the subplot tool into. If
            None, a default figure will be created. If you are using
            this from the GUI
        RQg�������?RPg�������?t
toolbarfmtcBseZd�Zd�ZRS(cSs
||_dS(N(tslider(R	R�((s8/usr/lib64/python2.7/site-packages/matplotlib/widgets.pyR
�scSs*d|jjj�|jjf}||S(Ns%s=%s(R�R4R�RZ(R	R�R�tfmt((s8/usr/lib64/python2.7/site-packages/matplotlib/widgets.pyR�s"(RRR
R(((s8/usr/lib64/python2.7/site-packages/matplotlib/widgets.pyR��s	i�s'Click on slider to adjust subplot paramiiR_i�tbottomi�R^i�ttopi�twspacei�thspaceg�������?g�������?g333333�?g333333�?tResetcs��j}t�_g}x'�D]}|j|j�t|_qWx�D]}|j�qIWx&t�|�D]\}}||_qmW|�_�jr��jj��jjj�ndS(N(RR;R RlR|RRIt	targetfig(R!t
thisdrawontbsR�tb(R	tslidersttoolfig(s8/usr/lib64/python2.7/site-packages/matplotlib/widgets.pyRH�s		



		
N(((R�tsubplots_adjusttadd_subplottaxleftt	set_titleR:R;RMtsubplotparsRQt
sliderleftRktfunclefttaxbottomR�tsliderbottomt
funcbottomtaxrightRPtsliderrightt	funcrighttaxtopR�t	slidertoptfunctoptaxwspaceR�tsliderwspacet
funcwspacetaxhspaceR�tsliderhspacet
funchspaceRaR`tadd_axesR)tbuttonresettvalidateRJ(R	R�R�R�tbaxRHR�((R	R�R�s8/usr/lib64/python2.7/site-packages/matplotlib/widgets.pyR
�sR	******cCs3|jjd|�|jr/|jjj�ndS(NRQ(R�R�RRRI(R	RT((s8/usr/lib64/python2.7/site-packages/matplotlib/widgets.pyR��s	cCs3|jjd|�|jr/|jjj�ndS(NRP(R�R�RRRI(R	RT((s8/usr/lib64/python2.7/site-packages/matplotlib/widgets.pyR�s	cCs3|jjd|�|jr/|jjj�ndS(NR�(R�R�RRRI(R	RT((s8/usr/lib64/python2.7/site-packages/matplotlib/widgets.pyR�s	cCs3|jjd|�|jr/|jjj�ndS(NR�(R�R�RRRI(R	RT((s8/usr/lib64/python2.7/site-packages/matplotlib/widgets.pyR�	s	cCs3|jjd|�|jr/|jjj�ndS(NR�(R�R�RRRI(R	RT((s8/usr/lib64/python2.7/site-packages/matplotlib/widgets.pyR�
s	cCs3|jjd|�|jr/|jjj�ndS(NR�(R�R�RRRI(R	RT((s8/usr/lib64/python2.7/site-packages/matplotlib/widgets.pyR�s	(
RRRR
R�R�R�R�R�R�(((s8/usr/lib64/python2.7/site-packages/matplotlib/widgets.pyR��s	j					tCursorcBs5eZdZed�Zd�Zd�Zd�ZRS(s{
    A horizontal and vertical line span the axes that and move with
    the pointer.  You can turn off the hline or vline spectively with
    the attributes

      *horizOn*
        Controls the visibility of the horizontal line

      *vertOn*
        Controls the visibility of the horizontal line

    and the visibility of the cursor itself with the *visible* attribute
    cKs�tj||�|jd|j�|jd|j�t|_t|_t|_||_	|rmt|d<n|j
|j�ddt|�|_
|j|j�ddt|�|_d|_t|_dS(s
        Add a cursor to *ax*.  If ``useblit=True``, use the backend-
        dependent blitting features for faster updates (GTKAgg
        only for now).  *lineprops* is a dictionary of line properties.

        .. plot :: mpl_examples/widgets/cursor.py
        R0t
draw_eventtanimateditvisibleN(RR
R$tonmovetclearRR�thorizOntvertOntuseblittaxhlinet
get_yboundR;tlinehRXt
get_xboundtlinevRt
backgroundt	needclear(R	RR�t	lineprops((s8/usr/lib64/python2.7/site-packages/matplotlib/widgets.pyR
$s					
%%	cCs^|j|�rdS|jr:|jj|jj�|_n|jjt	�|j
jt	�dS(sclear the cursorN(R(R�Rtcopy_from_bboxRtbboxR�R�R}R;R�(R	R!((s8/usr/lib64/python2.7/site-packages/matplotlib/widgets.pyR�?s	cCs|j|�rdS|jjj|�s,dS|j|jkr�|jjt�|j	jt�|j
r�|jj�t|_
ndSt|_
|j
s�dS|jj|j|jf�|j	j|j|jf�|jj|j
o�|j�|j	j|j
o|j�|j�dS(s*on mouse motion draw the cursor if visibleN(R(Rt
widgetlockRRCRR�R}R;R�R�RIRR�t	set_xdataRgt	set_ydatatydataR�R�R\(R	R!((s8/usr/lib64/python2.7/site-packages/matplotlib/widgets.pyR�Hs&	
		cCs~|jrm|jdk	r.|jj|j�n|jj|j�|jj|j�|jj	|jj
�n
|jj�tS(N(
R�R�RRtrestore_regionRtdraw_artistR�R�tblitR�t	draw_idleR;(R	((s8/usr/lib64/python2.7/site-packages/matplotlib/widgets.pyR\as	
(RRRR;R
R�R�R\(((s8/usr/lib64/python2.7/site-packages/matplotlib/widgets.pyR�s

			tMultiCursorcBs5eZdZed�Zd�Zd�Zd�ZRS(s
    Provide a vertical line cursor shared between multiple axes

    Example usage::

        from matplotlib.widgets import MultiCursor
        from pylab import figure, show, np

        t = np.arange(0.0, 2.0, 0.01)
        s1 = np.sin(2*np.pi*t)
        s2 = np.sin(4*np.pi*t)
        fig = figure()
        ax1 = fig.add_subplot(211)
        ax1.plot(t, s1)


        ax2 = fig.add_subplot(212, sharex=ax1)
        ax2.plot(t, s2)

        multi = MultiCursor(fig.canvas, (ax1, ax2), color='r', lw=1)
        show()

    c	Ks�||_||_|dj�\}}d||}|rIt|d<ng|D]}|j|dt|�^qP|_t|_||_d|_
t|_|jjd|j
�|jjd|j�dS(Ni����g�?R�R�R0R�(Rtaxestget_xlimRRXR;RzR�R�RR�R�RR�R�(	R	RR�R�R�txmintxmaxtxmidR((s8/usr/lib64/python2.7/site-packages/matplotlib/widgets.pyR
�s		
+				cCsO|jr*|jj|jjj�|_nx|jD]}|jt�q4WdS(sclear the cursorN(	R�RR�RR�R�RzR}R;(R	R!tline((s8/usr/lib64/python2.7/site-packages/matplotlib/widgets.pyR��s
		cCs�|jdkrdS|jjj|�s,dSt|_|jsBdSx:|jD]/}|j	|j
|j
f�|j|j�qLW|j�dS(N(
RCRRR�RRR�R�RzR�RgR}R\(R	R!R�((s8/usr/lib64/python2.7/site-packages/matplotlib/widgets.pyR��s		cCs�|jr}|jdk	r.|jj|j�nx0t|j|j�D]\}}|j|�qDW|jj	|jj
j�n
|jj�dS(N(
R�R�RRR�R|R�RzR�R�RR�R�(R	RR�((s8/usr/lib64/python2.7/site-packages/matplotlib/widgets.pyR\�s	"(RRRRR
R�R�R\(((s8/usr/lib64/python2.7/site-packages/matplotlib/widgets.pyR�os
			tSpanSelectorcBsbeZdZd	ed	d	d�Zd�Zd�Zd�Zd�Z	d�Z
d�Zd�ZRS(
so
    Select a min/max range of the x or y axes for a matplotlib Axes

    Example usage::

        ax = subplot(111)
        ax.plot(x,y)

        def onselect(vmin, vmax):
            print vmin, vmax
        span = SpanSelector(ax, onselect, 'horizontal')

    *onmove_callback* is an optional callback that is called on mouse
      move within the span range

    cCs�tj||�|dkr4tdddd�}n||_t|_d|_d|_d|_	||_
||_||_||_
||_t|_d|_d|_|j|�dS(s,
        Create a span selector in *ax*.  When a selection is made, clear
        the span and call *onselect* with::

            onselect(vmin, vmax)

        and clear the span.

        *direction* must be 'horizontal' or 'vertical'

        If *minspan* is not *None*, ignore events smaller than *minspan*

        The span rectangle is drawn with *rectprops*; default::
          rectprops = dict(facecolor='red', alpha=0.5)

        Set the visible attribute to *False* if you want to turn off
        the functionality of the span selector
        Rttredtalphag�?iN(ii(RR
Rtdictt	directionRR�trectR�tpressvt	rectpropstonselecttonmove_callbackR�tminspanR;t
buttonDowntprevRtnew_axes(R	RR�R�R�R�R�R�((s8/usr/lib64/python2.7/site-packages/matplotlib/widgets.pyR
�s"													c	Cs0||_|j|jjk	r�|j�|jj|_|jd|j�|jd|j�|jd|j�|jd|j�n|j	dkr�t
|jj|jj�}d
\}}n't
|jj|jj�}d\}}t
d||d|d	t|j�|_|js,|jj|j�ndS(
NR0R.R/R�t
horizontaliiR-R�(ii(ii(ii(RRRR'R$R�tpressRtupdate_backgroundR�Rt	transDataR3RR;R�R�R�R~(R	RttransR�R�((s8/usr/lib64/python2.7/site-packages/matplotlib/widgets.pyR�s&	
	cCs+|jr'|jj|jj�|_ndS(s!force an update of the backgroundN(R�RR�RR�R�(R	R!((s8/usr/lib64/python2.7/site-packages/matplotlib/widgets.pyR�s	cCs?|jp|j}|j|jkp2|jdk}|p>|S(s*return *True* if *event* should be ignoredi(R�RRCRRe(R	R!t
widget_offt	non_event((s8/usr/lib64/python2.7/site-packages/matplotlib/widgets.pyR("s!cCs]|j|�rdSt|_|jj|j�|jdkrM|j|_n|j	|_t
S(son button press eventNR�(R(RR�R�R}R�R�RgR�R�R;(R	R!((s8/usr/lib64/python2.7/site-packages/matplotlib/widgets.pyR�(s	cCs|j|�r|jrdS|jdkr0dSt|_|jjt�|jj�|j}|j	dkr�|j
p�|jd}n|jp�|jd}||kr�||}}n||}|j
dk	r�||j
kr�dS|j||�d|_tS(son button release eventNR�ii(R(R�R�RR;R�R}RRIR�RgR�R�R�R�(R	R!tvmintvmaxtspan((s8/usr/lib64/python2.7/site-packages/matplotlib/widgets.pyR5s&	
	
	cCsk|jrZ|jdk	r.|jj|j�n|jj|j�|jj|jj	�n
|jj
�tS(s^
        Draw using newfangled blit or oldfangled draw depending
        on *useblit*
        N(R�R�RRR�RR�R�R�R�R�R;(R	((s8/usr/lib64/python2.7/site-packages/matplotlib/widgets.pytupdateLs	
c	Cs{|jdks|j|�r"dS|j|j}}||f|_|jdkr\|}n|}||j}}||kr�||}}n|jdkr�|jj|�|jj	||�n$|jj
|�|jj||�|jdk	rm|j}|jdkr(|jp"|jd}n|jp;|jd}||krZ||}}n|j||�n|j
�tS(son motion notify eventNR�ii(R�RR(RgR�R�R�R�tset_xt	set_widthtset_yt
set_heightR�RR;(	R	R!R�R�tvtminvtmaxvRR((s8/usr/lib64/python2.7/site-packages/matplotlib/widgets.pyR�[s2		
N(
RRRRR;R
R�R�R(R�RRR�(((s8/usr/lib64/python2.7/site-packages/matplotlib/widgets.pyR��s/				
		tHorizontalSpanSelectorcBseZd�ZRS(cKs9ddl}|jdt�tj|||d|�dS(Ni����sUse SpanSelector instead!R�(twarningstwarntDeprecationWarningR�R
(R	RR�RdR((s8/usr/lib64/python2.7/site-packages/matplotlib/widgets.pyR
~s(RRR
(((s8/usr/lib64/python2.7/site-packages/matplotlib/widgets.pyR}stRectangleSelectorc	BsweZdZdddeddddd�Zd�Zd�Zd�Zd�Z	d�Z
d	�Zd
�Zd�Z
RS(
s�
    Select a min/max range of the x axes for a matplotlib Axes

    Example usage::

        from matplotlib.widgets import  RectangleSelector
        from pylab import *

        def onselect(eclick, erelease):
          'eclick and erelease are matplotlib events at press and release'
          print ' startposition : (%f, %f)' % (eclick.xdata, eclick.ydata)
          print ' endposition   : (%f, %f)' % (erelease.xdata, erelease.ydata)
          print ' used button   : ', eclick.button

        def toggle_selector(event):
            print ' Key pressed.'
            if event.key in ['Q', 'q'] and toggle_selector.RS.active:
                print ' RectangleSelector deactivated.'
                toggle_selector.RS.set_active(False)
            if event.key in ['A', 'a'] and not toggle_selector.RS.active:
                print ' RectangleSelector activated.'
                toggle_selector.RS.set_active(True)

        x = arange(100)/(99.0)
        y = sin(x)
        fig = figure
        ax = subplot(111)
        ax.plot(x,y)

        toggle_selector.RS = RectangleSelector(ax, onselect, drawtype='line')
        connect('key_press_event', toggle_selector)
        show()
    tboxtdatac	Cs0tj||�t|_|jd|j�|jd|j�|jd|j�|jd|j�t|_	d|_d|_|dkr�d}t
|_n|dkr|dkr�tdd	d
ddd
dt
�}n||_tddddt
|j�|_|jj|j�n|dkr�|dkrVtdddddddd
�}n||_tddgddgdt
|j�|_|jj|j�n||_||_||_||_|
dks�t|
t�r�|
|_nt|
t�r|
g|_n|	|_||_d|_ d|_!dS(s3
        Create a selector in *ax*.  When a selection is made, clear
        the span and call onselect with::

          onselect(pos_1, pos_2)

        and clear the drawn box/line. The ``pos_1`` and ``pos_2`` are
        arrays of length 2 containing the x- and y-coordinate.

        If *minspanx* is not *None* then events smaller than *minspanx*
        in x direction are ignored (it's the same for y).

        The rectangle is drawn with *rectprops*; default::

          rectprops = dict(facecolor='red', edgecolor = 'black',
                           alpha=0.5, fill=False)

        The line is drawn with *lineprops*; default::

          lineprops = dict(color='black', linestyle='-',
                           linewidth = 2, alpha=0.5)

        Use *drawtype* if you want the mouse to draw a line,
        a box or nothing between click and actual position by setting

        ``drawtype = 'line'``, ``drawtype='box'`` or ``drawtype = 'none'``.

        *spancoords* is one of 'data' or 'pixels'.  If 'data', *minspanx*
        and *minspanx* will be interpreted in the same coordinates as
        the x and y axis. If 'pixels', they are in pixels.

        *button* is a list of integers indicating which mouse buttons should
        be used for rectangle selection.  You can also specify a single
        integer if only a single button is desired.  Default is *None*,
        which does not limit which button can be used.

        Note, typically:
         1 = left mouse button
         2 = center mouse button (scroll wheel)
         3 = right mouse button
        R0R.R/R�tnoneR�RRttwhitet	edgecolortblackR�g�?tfilliiR�R?t	linestylet-RoiN(ii("RR
RR�R$R�R�RR�RRtto_drawR�R;R�R�RRR~R�RRR�R�tminspanxtminspanyt
isinstancetlisttvalidButtonstintt
spancoordstdrawtypet
eventpressteventrelease(R	RR�R!RRR�R�R�R Re((s8/usr/lib64/python2.7/site-packages/matplotlib/widgets.pyR
�sL.					!	*							cCs+|jr'|jj|jj�|_ndS(s!force an update of the backgroundN(R�RR�RR�R�(R	R!((s8/usr/lib64/python2.7/site-packages/matplotlib/widgets.pyR�s	cCsb|js
tS|jjj|�s&tS|jdk	rN|j|jkrNtSn|jdkrm|j	|j
kS|j|jjkr=|j	|j
kr=|j
jj�j
|j|jf�\}}|j
j�\}}|j
j�\}}t||�}t||�}t||�}t||�}||_||_tS|j	|j
kpa|j|jjkS(s*return *True* if *event* should be ignoredN(RRRR�RRRReR"RCRR�R�R�R�R�R�R�tmaxtminRgR�R;(R	R!RgR�tx0tx1ty0ty1((s8/usr/lib64/python2.7/site-packages/matplotlib/widgets.pyR(s,	'-		cCs3|j|�rdS|jj|j�||_tS(son button press eventN(R(RR}R�R"R;(R	R!((s8/usr/lib64/python2.7/site-packages/matplotlib/widgets.pyR�4s
	c

Cs�|jdks|j|�r"dS|jjt�|jj�||_|j	dkr�|jj
|jj}}|jj
|jj}}nP|j	dkr�|jj|jj
}}|jj|jj
}}ntd��||kr�||}}n||kr||}}n||}||}|jdk	oC||jk}|jdk	oa||jk}	|jdkr�|s|	r�dS|jdkr�|r�|	r�dS|j|j|j�d|_d|_tS(son button release eventNRtpixelss%spancoords must be "data" or "pixels"RR�(R"RR(RR}R;RRIR#R RgR�R�R�RRRR!R�(
R	R!R�tyminR�tymaxtspanxtspanyt	xproblemst	yproblems((s8/usr/lib64/python2.7/site-packages/matplotlib/widgets.pyR?s8
	

		cCsk|jrZ|jdk	r.|jj|j�n|jj|j�|jj|jj	�n
|jj
�tS(sBdraw using newfangled blit or oldfangled draw depending on useblitN(R�R�RRR�RR�RR�R�R�R;(R	((s8/usr/lib64/python2.7/site-packages/matplotlib/widgets.pyRjs	
cCsD|jdks|j|�r"dS|j|j}}|jdkr�|jj|}}|jj|}}||kr�||}}n||kr�||}}n|jj|�|jj|�|jj	||�|jj
||�|j�tS|jdkr@|jj
|jj|g|jj|g�|j�tSdS(s,on motion notify event if box/line is wantedNRR�(R"RR(RgR�R!RRRRRRR;tset_data(R	R!R�R�tminxtmaxxtminytmaxy((s8/usr/lib64/python2.7/site-packages/matplotlib/widgets.pyR�us*

cCs
||_dS(s�
        Use this to activate / deactivate the RectangleSelector
        from your program with an boolean parameter *active*.
        N(R(R	R((s8/usr/lib64/python2.7/site-packages/matplotlib/widgets.pyt
set_active�scCs|jS(s- Get status of active mode (boolean variable)(R(R	((s8/usr/lib64/python2.7/site-packages/matplotlib/widgets.pyt
get_active�sN(RRRRR;R
R�R(R�RRR�R6R7(((s8/usr/lib64/python2.7/site-packages/matplotlib/widgets.pyR�s!		]		(		+			t
LassoSelectorcBsMeZdZdedd�Zd�Zd�Zd�Zd�Z	d�Z
RS(s?Selection curve of an arbitrary shape.

    The selected path can be used in conjunction with
    :function:`~matplotlib.path.Path.contains_point` to select
    data points from an image.

    In contrast to :class:`Lasso`, `LassoSelector` is written with an interface
    similar to :class:`RectangleSelector` and :class:`SpanSelector` and will
    continue to interact with the axes until disconnected.

    Parameters:

    *ax* : :class:`~matplotlib.axes.Axes`
        The parent axes for the widget.
    *onselect* : function
        Whenever the lasso is released, the `onselect` function is called and
        passed the vertices of the selected path.

    Example usage::

        ax = subplot(111)
        ax.plot(x,y)

        def onselect(verts):
            print verts
        lasso = LassoSelector(ax, onselect)

    cCs�tj||�||_||_d|_|dkrCt�}ntgg|�|_|jj	t
�|jj|j�|j
d|j�|j
d|j�|j
d|j�|j
d|j�dS(NR.R/R0R�(RR
R�R�RtvertsR�RR�R}R;RRR$tonpresst	onreleaseR�R�(R	RR�R�R�((s8/usr/lib64/python2.7/site-packages/matplotlib/widgets.pyR
�s			cCs,t|d�o|jdk}|jp+|S(NRei(thasattrReR(R	R!twrong_button((s8/usr/lib64/python2.7/site-packages/matplotlib/widgets.pyR(�scCsQ|j|�s!|j|jkr%dS|j|jfg|_|jjt�dS(N(	R(RCRRgR�R9R�R}R(R	R!((s8/usr/lib64/python2.7/site-packages/matplotlib/widgets.pyR:�s!cCs�|j|�rdS|jdk	rf|j|jkrS|jj|j|jf�n|j|j�n|j	j
ggg�|j	jt�d|_dS(N(
R(R9RRCRR RgR�R�R�R1R}R;(R	R!((s8/usr/lib64/python2.7/site-packages/matplotlib/widgets.pyR;�scCs�|j|�s!|j|jkr%dS|jdkr8dS|j|jkrNdS|jdkradS|jj|j|jf�|j	j
t|j��|jr�|j
j|j�|jj|j	�|j
j|jj�n
|j
j�dS(Ni(R(RCRR9RReR RgR�R�R1R|R�RR�R�R�R�R�R�(R	R!((s8/usr/lib64/python2.7/site-packages/matplotlib/widgets.pyR��s!	cCs>|j|�rdS|jr:|jj|jj�|_ndS(N(R(R�RR�RR�R�(R	R!((s8/usr/lib64/python2.7/site-packages/matplotlib/widgets.pyR��s	N(RRRRRR
R(R:R;R�R�(((s8/usr/lib64/python2.7/site-packages/matplotlib/widgets.pyR8�s				tLassocBs/eZdZded�Zd�Zd�ZRS(s�Selection curve of an arbitrary shape.

    The selected path can be used in conjunction with
    :func:`~matplotlib.path.Path.contains_point` to select data points
    from an image.

    Unlike :class:`LassoSelector`, this must be initialized with a starting
    point `xy`, and the `Lasso` events are destroyed upon release.

    Parameters:

    *ax* : :class:`~matplotlib.axes.Axes`
        The parent axes for the widget.
    *xy* : array
        Coordinates of the start of the lasso.
    *callback* : function
        Whenever the lasso is released, the `callback` function is called and
        passed the vertices of the selected path.

    c	Cs�tj||�||_|r=|jj|jj�|_n|\}}||fg|_t	|g|gdddddd�|_
|jj|j
�||_|j
d|j�|j
d|j�dS(	NRRR?RROiR/R0(RR
R�RR�RR�R�R9RR�RR"R$R;R�(R	RRiR"R�R�R�((s8/usr/lib64/python2.7/site-packages/matplotlib/widgets.pyR
s	*	cCs�|j|�rdS|jdk	r|jj|j|jf�t|j�dkrf|j|j�n|jj	j
|j�nd|_|j�dS(Ni(
R(R9RR RgR�RuR"RRztremoveR�R'(R	R!((s8/usr/lib64/python2.7/site-packages/matplotlib/widgets.pyR;s	cCs�|j|�rdS|jdkr&dS|j|jkr<dS|jdkrOdS|jj|j|jf�|j	j
t|j��|jr�|j
j|j�|jj|j	�|j
j|jj�n
|j
j�dS(Ni(R(R9RRCRReR RgR�R�R1R|R�RR�R�R�R�R�R�(R	R!((s8/usr/lib64/python2.7/site-packages/matplotlib/widgets.pyR�%s	N(RRRRRR
R;R�(((s8/usr/lib64/python2.7/site-packages/matplotlib/widgets.pyR>�s	(Rt
__future__RtnumpyRvtmlabRtpatchesRRRzRt
transformsRRtobjectRRR)RMRmR�R�R�R�R�RRR8R>(((s8/usr/lib64/python2.7/site-packages/matplotlib/widgets.pyt<module>
s,&)w��y�YQ��]

Anon7 - 2021