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/contour.pyc
�
r`]c@ s�dZddlmZmZddlZddlZddlZddlm	Z	ddl
jZddlj
ZddljZddljZddljZddljZddljZddljZddljZddljZddl j!Z!ddl"j#Z$ddl%j&Z&ddl'j(Z)ddl*m+Z+dej,fd��YZ-dfd	��YZ.d
ej/e.fd��YZ0de0fd
��YZ1dS(sQ
These are  classes to support contour plotting and
labelling for the axes class
i����(tdivisiontprint_functionN(tma(tBlockingContourLabelert
ClabelTextcB seZdZd�ZRS(s�
    Unlike the ordinary text, the get_rotation returns an updated
    angle in the pixel coordinate assuming that the input rotation is
    an angle in data coordinate (or whatever transform set).
    cC shtjj|�}|j�}|j�\}}|jtj|g�tj||gg��}|dS(Ni(ttexttTexttget_rotationt
get_transformtget_positionttransform_anglestnptarray(tselftanglettranstxtyt
new_angles((s8/usr/lib64/python2.7/site-packages/matplotlib/contour.pyR*s(t__name__t
__module__t__doc__R(((s8/usr/lib64/python2.7/site-packages/matplotlib/contour.pyR$stContourLabelercB s�eZdZd�Zd�Zd�Zd�Zd�Zd�Zd�Z	d�Z
d	�Zdd
d�Z
d�Zd
�Zd�Zd�Zd�Zed
dd�Zdd�Zd�ZRS(s3Mixin to provide labelling capability to ContourSetcO s�|jdd�}|jdd�}|jdd�}|jdd�|_|jdd�}|jd	t�|_|jd
t�|_|jdt�|_t|�dkr�|j	}t
t|j��}n�t|�dkr�t|d�}	gg}}xFt
|j	�D]5\}
}||	kr|j|
�|j|�qqWt|�t|	�kr�d
t|	�}|d7}|t|j	�7}t|��q�ntd��||_||_tj�|_|dkr�t|jj��}
njt|�tttgkrtd��n@t|�tkrCt|jj��}
n|jj|�|}
|
gt|�|_|dkr�||_tj|j|j�|_ nWt!j"|dt|j��}t
t|j��|_ t#j$d|dt!j%��|_g|_&t'j(|j�rGx�|jD]"\}}|j)||||�qWn\|jr�t*d�t*d�|swt*d�nt+|�}|||�n|j,||�|j-|_.|j&|_/|j0|_1t'j2d|j-�|_3|j3S(s�
        Label a contour plot.

        Call signature::

          clabel(cs, **kwargs)

        Adds labels to line contours in *cs*, where *cs* is a
        :class:`~matplotlib.contour.ContourSet` object returned by
        contour.

        ::

          clabel(cs, v, **kwargs)

        only labels contours listed in *v*.

        Optional keyword arguments:

          *fontsize*:
            size in points or relative size eg 'smaller', 'x-large'

          *colors*:
            - if *None*, the color of each label matches the color of
              the corresponding contour

            - if one string color, e.g. *colors* = 'r' or *colors* =
              'red', all labels will be plotted in this color

            - if a tuple of matplotlib color args (string, float, rgb, etc),
              different labels will be plotted in different colors in the order
              specified

          *inline*:
            controls whether the underlying contour is removed or
            not. Default is *True*.

          *inline_spacing*:
            space in pixels to leave on each side of label when
            placing inline.  Defaults to 5.  This spacing will be
            exact for labels at locations where the contour is
            straight, less so for labels on curved contours.

          *fmt*:
            a format string for the label. Default is '%1.3f'
            Alternatively, this can be a dictionary matching contour
            levels with arbitrary strings to use for each contour level
            (i.e., fmt[level]=string), or it can be any callable, such
            as a :class:`~matplotlib.ticker.Formatter` instance, that
            returns a string when called with a numeric contour level.

          *manual*:
            if *True*, contour labels will be placed manually using
            mouse clicks.  Click the first button near a contour to
            add a label, click the second button (or potentially both
            mouse buttons at once) to finish adding labels.  The third
            button can be used to remove the last label added, but
            only if labels are not inline.  Alternatively, the keyboard
            can be used to select label locations (enter to end label
            placement, delete or backspace act like the third mouse button,
            and any other key will select a label location).

            *manual* can be an iterable object of x,y tuples. Contour labels
            will be created as if mouse is clicked at each x,y positions.

          *rightside_up*:
            if *True* (default), label rotations will always be plus
            or minus 90 degrees from level.

          *use_clabeltext*:
            if *True* (default is False), ClabelText class (instead of
            matplotlib.Text) is used to create labels. ClabelText
            recalculates rotation angles of texts during the drawing time,
            therefore this can be used if aspect of the axes changes.

        .. plot:: mpl_examples/pylab_examples/contour_demo.py
        tfontsizetinlineitinline_spacingitfmts%1.3ftcolorstuse_clabeltexttmanualtrightside_upisSpecified levels s
 don't match available levels s-Illegal arguments to clabel, see help(clabel)s$Font size must be an integer number.tNtcmaptnorms9Select label locations manually using first mouse button.s.End manual selection with second mouse button.s1Remove last label by clicking third mouse button.s	text.TextN(4tgettNonetlabelFmttFalset_use_clabeltexttlabelManualtTrueRtlentlevelstrangetcvaluestlistt	enumeratetappendtstrt
ValueErrort	TypeErrortlabelLevelListtlabelIndiceListtfont_managertFontPropertiestlabelFontPropstinttget_size_in_pointsttypetfloattset_sizetlabelFontSizeListt
labelMappableRttaketlabelCValueListRtListedColormaptcmtScalarMappabletNoNormtlabelXYstcbooktiterabletadd_label_neartprintRtlabelst
labelTextstcltcl_xytlabelCValuest
cl_cvaluestsilent_listtlabelTextsList(R
targstkwargsRRRt_colorsR*tindicestlevlabstitlevtmsgt	font_sizeR RRtblocking_contour_labeler((s8/usr/lib64/python2.7/site-packages/matplotlib/contour.pytclabel6sz\	


					


c	C s�t|�}|d|kr tStj|dd�df�}tj|dd�df�}tj|dd�df�}tj|dd�df�}|}||d|ks�||d|kr�tStSdS(s5Return *False* if contours are too short for a label.i
Niig333333�?(R)R(RtamaxtaminR%(	R
tlinecontourt
labelwidthtlcsizetxmaxtxmintymaxtymintlw((s8/usr/lib64/python2.7/site-packages/matplotlib/contour.pytprint_label�s(cC sWxP|jD]E}tj||dd||dd�}|d|kr
tSq
WtS(s7Return *True* if a label is already near this location.iiig333333�?(RERtsqrtR(R%(R
RRRftloctd((s8/usr/lib64/python2.7/site-packages/matplotlib/contour.pyt	too_close�s
+cC s�t|d�}tj|�}xP|D]H}||||||}	}
|j|	|
|�rdq&n|	|
|fSW|d}||||||}	}
|	|
|fS(s�
        Return x, y, and the index of a label location.

        Labels are plotted at a location with the smallest
        deviation of the contour from a straight line
        unless there is another label nearby, in which case
        the next best place on the contour is picked up.
        If all such candidates are rejected, the beginning
        of the contour is chosen.
        ii(R8RtargsortRk(R
t	distancestXXtYYtysizeRfthysizetadisttindRR((s8/usr/lib64/python2.7/site-packages/matplotlib/contour.pytget_label_coordss

cC stj|�s$|j||�}ntjj|�\}}|dkr�t|d�sitj�|_	n|j	j
||�\}}}nt|r�t|d�s�tjd�|_
n|j
j|ddd|j�\}}|j�}nt|�|d}|S(	s:
        Return the width of the label in points.
        tTeXt_TeX_managert_mathtext_parsertbitmaptdpiiHtpropg333333�?(RFtis_string_liketget_textRRtis_math_textthasattrt
texmanagert
TexManagerRvtget_text_width_height_descenttmathtexttMathTextParserRwtparseR7t	get_widthR)(R
RXRtfsizetismathRft_timg((s8/usr/lib64/python2.7/site-packages/matplotlib/contour.pytget_label_widths!'cC s�tjtj|jj��jdd�dd�}tj|d|d�}|j||j	||�d�|j
d|jjjj
�}tj|j�ddd�df�d}|S(s
        This computes actual onscreen label width.
        This uses some black magic to determine onscreen extent of non-drawn
        label.  This magic may not be very robust.

        This method is not being used, and may be modified or removed.
        itaxisiitktrendererN(RtmeantasarraytaxR�treshapeRRtset_label_propsR|tget_window_extenttfiguretcanvasR�tdifftcorners(R
RXRR�txxtttbboxRf((s8/usr/lib64/python2.7/site-packages/matplotlib/contour.pytget_real_label_width0s	3,cC sA|j|�|j|�|j|j�|j|jj�dS(s0set the label properties - color, fontsize, textN(tset_textt	set_colortset_fontpropertiesR7tset_clip_boxR�R�(R
tlabelRtcolor((s8/usr/lib64/python2.7/site-packages/matplotlib/contour.pyR�Js

cC sLtj|�r|St|t�r*||St|�r@||�S||SdS(sget the text of the labelN(RFR{t
isinstancetdicttcallable(R
RXR((s8/usr/lib64/python2.7/site-packages/matplotlib/contour.pyR|Qs
cC s#t|�}|dkr4ttj||��}nd}|dkrO|}nt|�}tj|dd�df||f�}tj|dd�df||f�}|dd�dfj|d�}|dd�dfj|d�}	|dd�dfj|d�}
|dd�dfj|d�}||||
|
||	|}tj||
d|	|d�j�}
tjj	gt
|�D]}t|�||
|^q�d�}|j|||||�\}}}g|D]}t
|�^q�}|j||f�}|||fS(sb
        Find a good place to plot a label (relatively flat
        part of the contour).
        iNii����i(R)R8RtceiltresizeR�RhtraveltaddtreduceR+tabsRtttupletindex(R
R_R`tnsizetxsizeRpRnRotyfirsttylasttxfirsttxlasttstLRWtdistRRRstltlctdind((s8/usr/lib64/python2.7/site-packages/matplotlib/contour.pytlocate_label]s(	((""""")@$ic	C s�|dkrg}n|d}tj|�}|r�tj||d!||d f}t|�r�tj||d!||d f}nd}ntj|�}|||}tj||g�}	|r�tj|ddg�}
ntj|	�}
tj	|||
|	dt
�}tj|dd�j�}tj
|dk�rLd}
n%tj|d|d�dtj}
|jr�|
d	kr�|
d}
n|
d
kr�d|
}
q�ng}t|�r�|
|	tj||g�}	tj	|tjt|��|	dt�}tj|d�rVt|d�|dkrVtj	|||	dg�}ntj|d�r�t|d�|dkr�tj	|||	dg�}ntj|d�tj|d�g}|rtj
tj|��r�|jtj|||d|dd!|f�q�q�tj|d�sZ|jtj||dd |f�ntj|d�s�|jtj|||df�q�n|
|fS(s
        This function calculates the appropriate label rotation given
        the linecontour coordinates in screen units, the index of the
        label location and the label width.

        It will also break contour and calculate inlining if *lc* is
        not empty (lc defaults to the empty list if None).  *spacing*
        is the space around the label in pixels to leave empty.

        Do both of these tasks at once to avoid calling mlab.path_length
        multiple times, which is relatively costly.

        The method used here involves calculating the path length
        along the contour in pixel coordinates and then looking
        approximately label width / 2 away from central point to
        determine rotation and then to break contour if desired.
        g@i����iitextrapR�gg�f@iZi����N(R#tmlabtis_closed_polygonRtr_R)tpath_lengthRt
zeros_liket less_simple_linear_interpolationR(R�R�talltarctan2tpiRtarangeR%tisnanR8tfloorR�R/(R
tslcRsRfR�tspacingthlwtclosedtpltxitdptlltddtrotationtnlctItxy1txy2((s8/usr/lib64/python2.7/site-packages/matplotlib/contour.pytcalc_label_rot_and_inline�s\	
"%			%	
$..&6)(c	C sO|jjj�j||f�\}}tj||d|dddd�}|S(NR�thorizontalalignmenttcentertverticalalignment(R�t	transDatatinvertedttransform_pointRR(R
RRR�tdxtdyR�((s8/usr/lib64/python2.7/site-packages/matplotlib/contour.pyt_get_label_text�s
'	c		C s�|jjj�}|j||f�\}}|jtj|g�tj||gg��}t||d|ddddd�}|S(NR�iR�R�R�(R�R�R�R�R
RRR(	R
RRR�ttransDataInvR�R�t	drotationR�((s8/usr/lib64/python2.7/site-packages/matplotlib/contour.pyt_get_label_clabeltext�s	cC s�|jj|d|j�}|j||j�}|j|||�|jj|�|jj|�|j	j||f�|j
j|�dS(Ntalpha(R>tto_rgbaR�R|R$R�RKR/RNRER�t
add_artist(R
R�RRRXtcvalueR�t_text((s8/usr/lib64/python2.7/site-packages/matplotlib/contour.pyt
_add_labelscC s2|j|||�}|j|||||�dS(sO
        Add contour label using :class:`~matplotlib.text.Text` class.
        N(R�R�(R
RRR�RXR�R�((s8/usr/lib64/python2.7/site-packages/matplotlib/contour.pyt	add_label
scC s2|j|||�}|j|||||�dS(sD
        Add contour label using :class:`ClabelText` class.
        N(R�R�(R
RRR�RXR�R�((s8/usr/lib64/python2.7/site-packages/matplotlib/contour.pytadd_label_clabeltexts	cC s�|dkr|jj}n|r?|j||f�\}}n|j|||j�d \}}}}	}
|jj|�}|j|j�}||j	}
|jjj
|
�}|j|j||j
|j|�}|r�|
}nd}|j|||||�\}}|j|	|
||j||j|�|r�|j|�x<|D]1}t|�dkrN|jtj|��qNqNWndS(sA
        Add a label near the point (x, y) of the given transform.
        If transform is None, data transform is used. If transform is
        False, IdentityTransform is used.

        *inline*:
          controls whether the underlying contour is removed or
          not. Default is *True*.

        *inline_spacing*:
          space in pixels to leave on each side of label when
          placing inline.  Defaults to 5.  This spacing will be
          exact for labels at locations where the contour is
          straight, less so for labels on curved contours.
        iiN(R#R�R�R�tfind_nearest_contourR4R�tcollectionst	get_pathstverticest	transformR�R3R$R=R�R�R@tpopR)R/tmpathtPath(R
RRRRR�tconmintsegmintiminRcRetlmintpathsR�R�RftlcargR�R�tn((s8/usr/lib64/python2.7/site-packages/matplotlib/contour.pyRH"s2%
	

i����cC s0|jj|�|jj|�}|j�dS(s>Defaults to removing last label, but any index can be suppliedN(RNR�RKtremove(R
R�R�((s8/usr/lib64/python2.7/site-packages/matplotlib/contour.pyt	pop_label`scC s|jr|j}n	|j}x�t|j|j|j|j�D]�\}}}}|j|}|j	�}	|j
||j|�}
|
|jj
jd9}
g}|j�}xAt|�D]3\}
}|j}|	j|�}tj|�rtj||dd�dd�ff}n|}|j||
�r�|j||
�\}}}|rZ|}nd}|j|||
||�\}}||||||�|r�x<|D]1}t|�dkr�|jtj|��q�q�Wq�q�|j|�q�W|r@|2|j|�q@q@WdS(NgR@ii( R&R�R�tzipR4R3R=R@R�RR�R$R�R�RyR�R.R�R�R�R�RR�RgR�R#R�R)R/R�R�textend(R
RRR�ticonRXR�R�tconRRft	additionsR�tsegNumtlinepathR�tslc0R�RRRsR�R�tnewR�((s8/usr/lib64/python2.7/site-packages/matplotlib/contour.pyRJfsF		
	,	
#N(RRRR\RgRkRtR�R�R�R|R�R#R�R�R�R�R�R�R(RHR�RJ(((s8/usr/lib64/python2.7/site-packages/matplotlib/contour.pyR3s(	�								%i					
=t
ContourSetcB s�eZdZd�Zd�Zd�Zded�Zd�Zd�Z	d�Z
d	�Zd
�Zd�Z
d�Zd
�Zd�Zd�Zd�Zd�Zd�Zded�ZRS(s�
    Store a set of contour lines or filled regions.

    User-callable method: clabel

    Useful attributes:
      ax:
        The axes object in which the contours are drawn

      collections:
        a silent_list of LineCollections or PolyCollections

      levels:
        contour levels

      layers:
        same as levels for line contours; half-way between
        levels for filled contours.  See :meth:`_process_colors`.
    cO s||_|jdd(�|_|jdt�|_|jdd(�|_|jdd(�|_|jdd(g�|_|jdd(�|_	|jdd(�|_
|jdd(�|_|jd	d(�}|jd
d(�|_|jdd(�}|jdd(�}|jd
d(�}|jdd�|_
|jdd(�|_|jd(kr_|jr_t|_n|jdd�|_|jdd(�|_t|tj�s�t|jtj�r�t|_|d(kr�tj�}n|j
dk	r�td��q�n	t|_|j
d(k	r%|j
d)ks%t�n|jd(k	rRt|j�dksRt�n|jd(k	r||d(k	r|td��n|j
dkr�tjd|_
n|jdd(�|_|j||�|j�|jd(k	rt|j�}|jr|d8}ntj|jd|�}n|jr:t j!d�|_"nt j!d�|_"g|_#g|_$i|d	6}	|d(k	r�||	d<nt%j&j'||	�|d(k	r�||j(_)n|d(k	r�||j(_*n|j+�|j,�\|_-|_.|jr	|jd(k	rt/j0d �n|j1�\}
}|j.d(krTd(gt|j-�|_.nx�t2|
||j-|j.�D]�\}}
}}|j3||�}|jd!d�}t4j5|d"|jfd#d$d|j	d|j6�d!|�}|jj7|�|j"j8|�qpWn�|j9�}||_:|j;�}|j}|d(k	rN|jf}nx�t2|j|||j-�D]�\}}}}|jd!d%�}t4j<|d"|d|d&|d|j	d|j6�d!|�}|j=d'�|jj7|t�|j"j8|�qjW|j>�d(S(*s
        Draw contour lines or filled regions, depending on
        whether keyword arg 'filled' is *False* (default) or *True*.

        The first three arguments must be:

          *ax*: axes object.

          *levels*: [level0, level1, ..., leveln]
            A list of floating point numbers indicating the contour
            levels.

          *allsegs*: [level0segs, level1segs, ...]
            List of all the polygon segments for all the *levels*.
            For contour lines ``len(allsegs) == len(levels)``, and for
            filled contour regions ``len(allsegs) = len(levels)-1``.

            level0segs = [polygon0, polygon1, ...]

            polygon0 = array_like [[x0,y0], [x1,y1], ...]

          *allkinds*: *None* or [level0kinds, level1kinds, ...]
            Optional list of all the polygon vertex kinds (code types), as
            described and used in Path.   This is used to allow multiply-
            connected paths such as holes within filled polygons.
            If not *None*, len(allkinds) == len(allsegs).

            level0kinds = [polygon0kinds, ...]

            polygon0kinds = [vertexcode0, vertexcode1, ...]

            If *allkinds* is not *None*, usually all polygons for a particular
            contour level are grouped together so that

            level0segs = [polygon0] and level0kinds = [polygon0kinds].

        Keyword arguments are as described in
        :class:`~matplotlib.contour.QuadContourSet` object.

        **Examples:**

        .. plot:: mpl_examples/misc/contour_manual.py
        R*tfilledt
linewidthst
linestylesthatchesR�torigintextentR RR!tvmintvmaxR�tneithertantialiasedtnchunkitlocators-extend kwarg does not work yet with log scaletlowertuppertimageis"Either colors or cmap must be Nonesimage.originR�iRsmcoll.PathCollectionsmcoll.LineCollections!linewidths is ignored by contourftzordertantialiasedst
edgecolorstnoneit	linestylet
_nolegend_N(slowersupperR(?R�R"R#R*R%RRRRR�R	R
RR�RRRR�tLogNormttickert
LogLocatorR(tlogscaleR1tAssertionErrorR)tmpltrcParamst
_transformt
_process_argst_process_levelsRARFRPR�RKRNRBRCt__init__R!RRt_process_colorst_get_allsegs_and_allkindstallsegstallkindstwarningstwarnt_get_lowers_and_uppersR�t_make_pathstmcolltPathCollectionRtadd_collectionR/t_process_linewidthsttlinewidthst_process_linestylestLineCollectiont	set_labeltchanged(R
R�RRRSR R!RRtncolorstkwtlowerstupperstleveltlevel_uppertsegstkindsR�RtcolR1ttlinestylestaatwidthtlstyle((s8/usr/lib64/python2.7/site-packages/matplotlib/contour.pyR$�s�,			
	
			


	+				+		
cC sk|jdkr!|jj|_nCt|jtj�rdt|jd�rd|jj|j�|_n|jS(sp
        Return the :class:`~matplotlib.transforms.Transform`
        instance used by this ContourSet.
        t_as_mpl_transformN(	R!R#R�R�R�tmtranst	TransformR~RC(R
((s8/usr/lib64/python2.7/site-packages/matplotlib/contour.pyRWscC s|jj�}d|d<|S(NtCntr(t__dict__tcopyR#(R
tstate((s8/usr/lib64/python2.7/site-packages/matplotlib/contour.pyt__getstate__cs
RcC s�g}g}|jrX|j�\}}t|j�}x�tt|j||��D]�\}\}	}
}tjd
ddd|	j�dd|	j	�d|	j
��}|j|�||
�}
||�}|dkr�|jdkr�|jd||
f�qR||dkr7|jdkr7|jd
||f�qR|jd|
||f�qRWnrxot|j|j
�D]X\}	}
tjd�}|j|	�|j|�||
�}
|jd||
f�qnW||fS(sQ
        Return a list of artist and labels suitable for passing through
        to :func:`plt.legend` which represent this ContourSet.

        Args:

            *variable_name*: the string used inside the inequality used
              on the labels

            *str_format*: function used to format the numbers in the labels
        iit	facecolorthatchR�tmintboths$%s \leq %s$tmaxs	$%s > %s$s$%s < %s \leq %s$s	$%s = %s$(ii(sminRN(smaxRNN(RR+R)R�R.R�tmpatchest	Rectanglet
get_facecolort	get_hatcht	get_alphaR/R�R*R-R3R#tupdate_from(R
t
variable_namet
str_formattartistsRJR8R9tn_levelsRWt
collectionRRtpatchR:((s8/usr/lib64/python2.7/site-packages/matplotlib/contour.pytlegend_elementsjs4	"
!"

c
O s�|d|_|d|_t|�dkr6|dp9d	|_tj|j�|_tj|j�|_	t
|_|jr�t|j�t|j�dkr�t
d��q�n-t|j�t|j�kr�t
d��n|jd	k	rt|j�t|j�krt
d��nt
}x�|jD]�}x�|D]�}tj|�}|r�tj||jdd��}tj||jdd��}q5|jdd�}|jdd�}t}q5Wq(W|r�|jj||g�|jjdt�nd	S(
s�
        Process *args* and *kwargs*; override in derived classes.

        Must set self.levels, self.zmin and self.zmax, and update axes
        limits.
        iiis-must be one less number of segments as levelss)must be same number of segments as levelss(allkinds has different length to allsegsR�ttightN(R*R'R)R#R(RR]tzmaxR^tzminR%t_autoRR1R�tminimumRMtmaximumROR(R�tupdate_datalimtautoscale_view(R
RRRSt
havelimitsR<tsegRMRO((s8/usr/lib64/python2.7/site-packages/matplotlib/contour.pyR"�s4

%		"-
!cC s|j|jfS(sv
        Override in derived classes to create and return allsegs and allkinds.
        allkinds can be None.
        (R'R((R
((s8/usr/lib64/python2.7/site-packages/matplotlib/contour.pyR&�scC ss|jd }|j|dkr\|j�}|jrId|j|d<q\|dcd8<n|jd}||fS(s=
        Return (lowers,uppers) for filled contours.
        i����ig�G�z��?i(t_levelsR_RHR(R
R8R9((s8/usr/lib64/python2.7/site-packages/matplotlib/contour.pyR+�s
	
cC se|dk	rAgt||�D]!\}}tj|d|�^qSg|D]}tj|�^qHSdS(Ntcodes(R#R�R�R�(R
R<R=Rftkind((s8/usr/lib64/python2.7/site-packages/matplotlib/contour.pyR,�s5c	C sg|j|jd|j�D]}t|�f^q}||_|jt|�}xYt|||j�D]B\}}}|j	r�|j
|�|j|�qi|j|�qiWxLt|j
|j�D]5\}}|j|j�|j|jj|��q�Wtjj|�dS(NR�(R�R,R�R�ttcolorsRR)R�R�Rt
set_facecolort	set_hatchR�RKRNt	set_alphaR>RBRCR5(	R
trgbaRjRR�RLRZR�tcv((s8/usr/lib64/python2.7/site-packages/matplotlib/contour.pyR5�s4	%	
"cC s�|jdkrC|jr*tj�|_qCtj|d�|_n|j}|j}|jj||�}t	|_
|jr�|S|||k||k@S(s�
        Select contour levels to span the data.

        We need two more levels for filled contours than for
        line contours, because for the latter we need to specify
        the lower and upper boundary of each range. For example,
        a single contour boundary, say at z = 0, requires only
        one contour line, but two filled regions, and therefore
        three levels to provide boundaries for both regions.
        iN(RR#RRRtMaxNLocatorR^R_ttick_valuesR(R`R(R
tzRR^R_RX((s8/usr/lib64/python2.7/site-packages/matplotlib/contour.pyt_autolev�s					cC s|jrd}nd}t|_|jdkr�t|�dkrW|j|d�}np|d}yFt|�tkr�|j||�}nt	j
|�jt	j�}Wnt
d||f��nX||_n|jrt|j�dkrtd��ndS(	sH
        Determine the contour levels and store in self.levels.
        tcontourftcontouriis*Last %s arg must give levels; see help(%s)is*Filled contours require at least 2 levels.N(RR%R`R*R#R)RsR:R8RR�tastypetfloat64R2R1(R
RrRRtfnRXt	level_arg((s8/usr/lib64/python2.7/site-packages/matplotlib/contour.pyt_contour_level_argss$			
cC sGtj|j�|_tj|j�|_t|j�|_|jsU|j|_	dS|j
d	kr�|jjdt|jd|j
�d�n|j
d
kr�|jjt|jd|j�d�ntj|j�|_d|jd |jd|_	|j
dkr!tj|j	d<n|j
dkrCtj|j	d<ndS(
s&
        Assign values to :attr:`layers` based on :attr:`levels`,
        adding extended layers as needed if contours are filled.

        For line contours, layers simply coincide with levels;
        a line is a thin layer.  No extended levels are needed
        with line contours.
        NRNRMiiROi����g�?(sbothsmin(sbothsmax(sbothsmin(sbothsmax(RR^R*RR]RR-RgRtlayersR�tinsertRMR_R/ROR^R�tinf(R
((s8/usr/lib64/python2.7/site-packages/matplotlib/contour.pyR#&s 	-*cC s�|jj|_|jdk	r�dt|j�}}|jrJ|d8}n|jdkrbd}n|jd	kr~|d7}ntt	||��|_
|jtj��n|j
|_
|j|j�|j�|jd
kr�t|j_ndS(s
        Color argument processing for contouring.

        Note that we base the color mapping on the contour levels
        and layers, not on the actual range of the Z values.  This
        means we don't have to worry about bad values in Z, and we
        always have the full dynamic range available for the selected
        levels.

        The color is based on the midpoint of the layer, except for
        extended end layers.  By default, the norm vmin and vmax
        are the extreme values of the non-extended levels.  Hence,
        the layer color extremes are not the extreme values of
        the colormap itself, but approach those values as the number
        of levels increases.  An advantage of this scheme is that
        line contours, when added to filled contours, take on
        colors that are consistent with those of the filled regions;
        for example, a contour line on the boundary between two
        regions will have a color intermediate between those
        of the regions.

        iiRNRMi����RON(sbothsmin(sbothsmax(sbothsmaxsmin(R t
monochromeRR#R)R*RR�R-R+R,tset_normRDR{t	set_arraytautoscale_NoneR%R!tclip(R
ti0ti1((s8/usr/lib64/python2.7/site-packages/matplotlib/contour.pyR%Ls 	
	

cC s�|j}t|j�}|dkr>tjdfg|}n�tj|�s]|g|}nit|�}t|�|kr�t	t
j|t|���}||}nt|�|kr�|| }ng|D]}|f^q�}|S(Nslines.linewidth(RR)R*R#RR RFRGR-R8RR�(R
RtNlevR1tnrepstw((s8/usr/lib64/python2.7/site-packages/matplotlib/contour.pyR0ys	

c	C sE|j}t|j�}|dkr�dg|}|jrAtjd}|j|jd}x9t	|j�D]%\}}||krl|||<qlqlWqAn�t
j|�r�|g|}n�t
j|�r5t
|�}t|�|krttj|t|���}||}nt|�|krA|| }qAntd��|S(Ntsolidscontour.negative_linestylegV瞯�<s&Unrecognized type for linestyles kwarg(RR)R*R#R~RR R^R_R.RFR{RGR-R8RR�R1(	R
RR�R?tneg_lstepsRWRXR�((s8/usr/lib64/python2.7/site-packages/matplotlib/contour.pyR2�s*	
	

cC s|jS(s5returns alpha to be applied to all ContourSet artists(R�(R
((s8/usr/lib64/python2.7/site-packages/matplotlib/contour.pyRT�scC s||_|j�dS(s%sets alpha for all ContourSet artistsN(R�R5(R
R�((s8/usr/lib64/python2.7/site-packages/matplotlib/contour.pyRm�s	cC so|dkr$tt|j��}nd}d}d}d}d}	x|D]}
|j|
}|j�}|j�}
x�t|
�D]�\}}|j}|r�|j	|�}n|dd�df|d|dd�df|d}t
|�}||kr�|}|
}|}tjj
||k�d}||df}||df}	q�q�WqIW|||||	|fS(sX
        Finds contour that is closest to a point.  Defaults to
        measuring distance in pixels (screen space - useful for manual
        contour labeling), but this can be controlled via a keyword
        argument.

        Returns a tuple containing the contour, segment, index of
        segment, x & y of segment point and distance to minimum point.

        Call signature::

          conmin,segmin,imin,xmin,ymin,dmin = find_nearest_contour(
                     self, x, y, indices=None, pixel=True )

        Optional keyword arguments:

          *indices*:
            Indexes of contour levels to consider when looking for
            nearest point.  Defaults to using all levels.

          *pixel*:
            If *True*, measure distance in pixel space, if not, measure
            distance in axes space.  Defaults to *True*.

        g _�BNiii(R#R+R)R*R�RR�R.R�R�RMRR�tfind(R
RRRUtpixeltdminR�R�RcReR�R�RR�RRR�tdsRjR�((s8/usr/lib64/python2.7/site-packages/matplotlib/contour.pyR��s2#

	:N(RRRR$RRJR0R\R"R&R+R,R5RsRzR#R%R0R2RTRmR#R(R�(((s8/usr/lib64/python2.7/site-packages/matplotlib/contour.pyR�s&	�		2	+							&	-				tQuadContourSetcB sJeZdZd�Zd�Zd�Zd�Zd�Zd�ZdZ	RS(s�
    Create and store a set of contour lines or filled regions.

    User-callable method: :meth:`clabel`

    Useful attributes:
      ax:
        The axes object in which the contours are drawn

      collections:
        A silent_list of LineCollections or PolyCollections

      levels:
        Contour levels

      layers:
        Same as levels for line contours; half-way between
        levels for filled contours.  See :meth:`_process_colors` method.
    cO stj||||�dS(sF
        Calculate and draw contour lines or filled regions, depending
        on whether keyword arg 'filled' is False (default) or True.

        The first argument of the initializer must be an axes
        object.  The remaining arguments and keyword arguments
        are described in QuadContourSet.contour_doc.
        N(RR$(R
R�RRRS((s8/usr/lib64/python2.7/site-packages/matplotlib/contour.pyR$s	cO s�t|dt�re|dj}|jdkrB|dj|_n|dj|_|dj|_n^|j||�\}}}tj	|�}|tj
kr�d}ntj|||j�|�}|j
�}||jjkrRt|j|jj��rR||jj}	tj|j|jg�j}
|	j|
�}|d}|d}ntj|�}tj|�}
tj|�}tj|�}|jj||f|
|fg�|jjdt�||_dS(s*
        Process args and kwargs.
        i.iR]N(.i(.i(R�R�RFR*R#R_R^t
_contour_argsRtgetmasktnomaskt_cntrRRR�R�tanytcontains_branch_seperatelyRtvstacktflattTR�RaRbRcRdR((R
RRRStCRRRrt_maskR�t
trans_to_datatptsttransformed_ptstx0tx1ty0ty1((s8/usr/lib64/python2.7/site-packages/matplotlib/contour.pyR"s4
	

"cC sg}|jr�|j�\}}g}x�t||�D]h\}}|jj||d|j�}t|�d}|| }	||}
|j|	�|j|
�q7WnSd}xJ|j	D]?}|jj|�}t|�d}|| }	|j|	�q�W||fS(sV
        Create and return allsegs and allkinds by calling underlying C code.
        RiN(
RR+R�RFttraceRR)R/R#R*(R
R'R8R9R(R:R;tnlisttnsegR<R=((s8/usr/lib64/python2.7/site-packages/matplotlib/contour.pyR&7s$	



cC sa|jrd}nd}t|�}|dkrntj|ddtj�}|j|�\}}|d}nN|dkr�|j|d |�\}}}|d}ntd	||f��tj	|d
t
�}tj|�|_tj
|�|_|jrD|jdkrDtj|dk|�}tjd�|j�|_n|j||�|||fS(NRtRuiitdtypeiiis&Too many arguments to %s; see help(%s)RHs,Log scale: values of z <= 0 have been masked(RR)RR�RRwt_initialize_x_yt
_check_xyzR2tmasked_invalidR%RbR^RaR_Rtmasked_whereR)R*RMRz(R
RRRSRxtNargsRrRR((s8/usr/lib64/python2.7/site-packages/matplotlib/contour.pyR�Os*		


c
C s�|d \}}|jjd|d|d|�|jj|�}|jj|�}tj|dtj�}tj|dtj�}tj|ddtj�}|jdkr�t	d��n|j
\}}|j
|j
kr�|j
|j
kr�|||fS|jdks|jdkr*t	d��n|j
\}|j
\}	||ksZ|	|krmt	d	d
��ntj||�\}}|||fS(s 
        For functions like contour, check that the dimensions
        of the input arrays match; if x and y are 1D, convert
        them to 2D using meshgrid.

        Possible change: I think we should make and use an ArgumentError
        Exception class (here and elsewhere).
        itxdatatydataRSR�sInput z must be a 2D array.is Inputs x and y must be 1D or 2D.s,Length of x must be number of columns in z,
s'and length of y must be number of rows.(R�t_process_unit_infotconvert_xunitstconvert_yunitsRR�RwRtndimR2tshapetmeshgrid(
R
RRRSRRRrtNytNxtnxtny((s8/usr/lib64/python2.7/site-packages/matplotlib/contour.pyR�fs*	$

cC s�|jdkrtd��n|j\}}|jdkr�|jdkrmtjtj|�tj|��S|j\}}}}tj	|||�}tj	|||�}	tj||	�Sn|jdkr�d|d|f\}}}}n|j\}}}}t
||�|}
t
||�|}|tj|�d|
}|tj|�d|}	|jdkr�|	ddd�}	ntj||	�S(s
        Return X, Y arrays such that contour(Z) will match imshow(Z)
        if origin is not None.
        The center of pixel Z[i,j] depends on origin:
        if origin is None, x = j, y = i;
        if origin is 'lower', x = j + 0.5, y = i + 0.5;
        if origin is 'upper', x = j + 0.5, y = Nrows - i - 0.5
        If extent is not None, x and y will be scaled to match,
        as in imshow.
        If origin is None and extent is not None, then extent
        will give the minimum and maximum values of x and y.
        isInput must be a 2D array.ig�?RNi����(R�R2R�R	R#R
RR�R�tlinspaceR;(R
RrR�R�R�R�R�R�RRR�R�((s8/usr/lib64/python2.7/site-packages/matplotlib/contour.pyR��s(
"!s�
        Plot contours.

        :func:`~matplotlib.pyplot.contour` and
        :func:`~matplotlib.pyplot.contourf` draw contour lines and
        filled contours, respectively.  Except as noted, function
        signatures and return values are the same for both versions.

        :func:`~matplotlib.pyplot.contourf` differs from the MATLAB
        version in that it does not draw the polygon edges.
        To draw edges, add line contours with
        calls to :func:`~matplotlib.pyplot.contour`.


        Call signatures::

          contour(Z)

        make a contour plot of an array *Z*. The level values are chosen
        automatically.

        ::

          contour(X,Y,Z)

        *X*, *Y* specify the (x, y) coordinates of the surface

        ::

          contour(Z,N)
          contour(X,Y,Z,N)

        contour *N* automatically-chosen levels.

        ::

          contour(Z,V)
          contour(X,Y,Z,V)

        draw contour lines at the values specified in sequence *V*

        ::

          contourf(..., V)

        fill the ``len(V)-1`` regions between the values in *V*

        ::

          contour(Z, **kwargs)

        Use keyword args to control colors, linewidth, origin, cmap ... see
        below for more details.

        *X* and *Y* must both be 2-D with the same shape as *Z*, or they
        must both be 1-D such that ``len(X)`` is the number of columns in
        *Z* and ``len(Y)`` is the number of rows in *Z*.

        ``C = contour(...)`` returns a
        :class:`~matplotlib.contour.QuadContourSet` object.

        Optional keyword arguments:

          *colors*: [ *None* | string | (mpl_colors) ]
            If *None*, the colormap specified by cmap will be used.

            If a string, like 'r' or 'red', all levels will be plotted in this
            color.

            If a tuple of matplotlib color args (string, float, rgb, etc),
            different levels will be plotted in different colors in the order
            specified.

          *alpha*: float
            The alpha blending value

          *cmap*: [ *None* | Colormap ]
            A cm :class:`~matplotlib.colors.Colormap` instance or
            *None*. If *cmap* is *None* and *colors* is *None*, a
            default Colormap is used.

          *norm*: [ *None* | Normalize ]
            A :class:`matplotlib.colors.Normalize` instance for
            scaling data values to colors. If *norm* is *None* and
            *colors* is *None*, the default linear scaling is used.

          *vmin*, *vmax*: [ *None* | scalar ]
            If not *None*, either or both of these values will be
            supplied to the :class:`matplotlib.colors.Normalize`
            instance, overriding the default color scaling based on
            *levels*.

          *levels*: [level0, level1, ..., leveln]
            A list of floating point numbers indicating the level
            curves to draw; eg to draw just the zero contour pass
            ``levels=[0]``

          *origin*: [ *None* | 'upper' | 'lower' | 'image' ]
            If *None*, the first value of *Z* will correspond to the
            lower left corner, location (0,0). If 'image', the rc
            value for ``image.origin`` will be used.

            This keyword is not active if *X* and *Y* are specified in
            the call to contour.

          *extent*: [ *None* | (x0,x1,y0,y1) ]

            If *origin* is not *None*, then *extent* is interpreted as
            in :func:`matplotlib.pyplot.imshow`: it gives the outer
            pixel boundaries. In this case, the position of Z[0,0]
            is the center of the pixel, not a corner. If *origin* is
            *None*, then (*x0*, *y0*) is the position of Z[0,0], and
            (*x1*, *y1*) is the position of Z[-1,-1].

            This keyword is not active if *X* and *Y* are specified in
            the call to contour.

          *locator*: [ *None* | ticker.Locator subclass ]
            If *locator* is *None*, the default
            :class:`~matplotlib.ticker.MaxNLocator` is used. The
            locator is used to determine the contour levels if they
            are not given explicitly via the *V* argument.

          *extend*: [ 'neither' | 'both' | 'min' | 'max' ]
            Unless this is 'neither', contour levels are automatically
            added to one or both ends of the range so that all data
            are included. These added ranges are then mapped to the
            special colormap values which default to the ends of the
            colormap range, but can be set via
            :meth:`matplotlib.colors.Colormap.set_under` and
            :meth:`matplotlib.colors.Colormap.set_over` methods.

          *xunits*, *yunits*: [ *None* | registered units ]
            Override axis units by specifying an instance of a
            :class:`matplotlib.units.ConversionInterface`.

          *antialiased*: [ *True* | *False* ]
            enable antialiasing, overriding the defaults.  For
            filled contours, the default is *True*.  For line contours,
            it is taken from rcParams['lines.antialiased'].

        contour-only keyword arguments:

          *linewidths*: [ *None* | number | tuple of numbers ]
            If *linewidths* is *None*, the default width in
            ``lines.linewidth`` in ``matplotlibrc`` is used.

            If a number, all levels will be plotted with this linewidth.

            If a tuple, different levels will be plotted with different
            linewidths in the order specified

          *linestyles*: [ *None* | 'solid' | 'dashed' | 'dashdot' | 'dotted' ]
            If *linestyles* is *None*, the default is 'solid' unless
            the lines are monochrome.  In that case, negative
            contours will take their linestyle from the ``matplotlibrc``
            ``contour.negative_linestyle`` setting.

            *linestyles* can also be an iterable of the above strings
            specifying a set of linestyles to be used. If this
            iterable is shorter than the number of contour levels
            it will be repeated as necessary.

        contourf-only keyword arguments:

          *nchunk*: [ 0 | integer ]
            If 0, no subdivision of the domain. Specify a positive integer to
            divide the domain into subdomains of roughly *nchunk* by *nchunk*
            points. This may never actually be advantageous, so this option may
            be removed. Chunking introduces artifacts at the chunk boundaries
            unless *antialiased* is *False*.

          *hatches*:
            A list of cross hatch patterns to use on the filled areas.
            If None, no hatching will be added to the contour.
            Hatching is supported in the PostScript, PDF, SVG and Agg
            backends only.


        Note: contourf fills intervals that are closed at the top; that
        is, for boundaries *z1* and *z2*, the filled region is::

            z1 < z <= z2

        There is one exception: if the lowest boundary coincides with
        the minimum value of the *z* array, then that minimum value
        will be included in the lowest interval.

        **Examples:**

        .. plot:: mpl_examples/pylab_examples/contour_demo.py

        .. plot:: mpl_examples/pylab_examples/contourf_demo.py
        (
RRRR$R"R&R�R�R�tcontour_doc(((s8/usr/lib64/python2.7/site-packages/matplotlib/contour.pyR��s		'			 	�(2Rt
__future__RRR)t
matplotlibRtnumpyRRtmatplotlib._cntrR�tmatplotlib.pathtpathR�tmatplotlib.tickerRt
matplotlib.cmRBtmatplotlib.colorsRtmatplotlib.collectionsR�R-tmatplotlib.font_managerR5tmatplotlib.textRtmatplotlib.cbookRFtmatplotlib.mlabR�tmatplotlib.mathtextR�tmatplotlib.patchestpatchesRPtmatplotlib.texmanagerRtmatplotlib.transformst
transformsRDtmatplotlib.blocking_inputRRRRRCRR�(((s8/usr/lib64/python2.7/site-packages/matplotlib/contour.pyt<module>s8
��m��U

Anon7 - 2021