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: //opt/alt/python27/lib64/python2.7/site-packages/matplotlib/contour.pyo
�
�)�Uc@ spdZddlmZddlZddlZddlZddlmZddl	j
Z
ddljZ
ddljZddljZddljZddljZddljZddljZddljZddljZddljZddl j!Z!ddl"m#Z#dej$fd��YZ%dfd	��YZ&d
ej'e&fd��YZ(de(fd
��YZ)dS(sQ
These are  classes to support contour plotting and
labelling for the axes class
i����(tdivisionN(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((sE/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/contour.pyR(s(t__name__t
__module__t__doc__R(((sE/opt/alt/python27/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�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|��}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|�tkr@t|jj��}
n|jj|�|}
|
gt|�|_|dkr�||_tj|j|j�|_ nWt!j"|dt|j��}t
t|j��|_ t#j$d|dt!j%��|_g|_&|jr<dGHdGH|s dGHnt'|�}|||�n|j(||�|j)|_*|j&|_+|j,|_-t.j/d|j)�|_0|j0S(s}

        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*:
            See http://matplotlib.sf.net/fonts.html

          *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)

          *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).

          *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(1tgettNonetlabelFmttFalset_use_clabeltexttlabelManualtTrueRtlentlevelstrangetlistt	enumeratetappendtstrt
ValueErrort	TypeErrortlabelLevelListtlabelIndiceListtfont_managertFontPropertiestlabelFontPropstinttget_size_in_pointsttypetfloattset_sizetlabelFontSizeListt
labelMappableR
ttaketcvaluestlabelCValueListRtListedColormaptcmtScalarMappabletNoNormtlabelXYsRtlabelst
labelTextstcltcl_xytlabelCValuest
cl_cvaluestcbooktsilent_listtlabelTextsList(RtargstkwargsRRRt_colorsR)tindicestlevlabstitlevtmsgt	font_sizeRtblocking_contour_labeler((sE/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/contour.pytclabel4srU	


					c	C s�t|�}|d|kr dStj|dd�df�}tj|dd�df�}tj|dd�df�}tj|dd�df�}|}||d|ks�||d|kr�dSdSdS(s-if contours are too short, don't plot a labeli
iNig333333�?(R(R
tamaxtamin(	Rtlinecontourt
labelwidthtlcsizetxmaxtxmintymaxtymintlw((sE/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/contour.pytprint_label�s(cC s�|jgkr|g|jD]1}tj||dd||dd�^q}x-|D]}|d|krqdSdSqWWndSdS(s6if there's a label already nearby, find a better placeiiig333333�?N(RDR
tsqrt(RRRRbtloctdisttd((sE/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/contour.pyt	too_close�s>
cC s�t|d�}tj|�}xS|D]K}||||||}	}
|j|	|
|�rdq&q&|	|
|fSq&W|d}||||||}	}
|	|
|fS(sB labels are ploted at a location with the smallest
        dispersion of the contour from a straight line
        unless there's another label nearby, in which case
        the second best place on the contour is picked up
        if there's no good place a label isplotted at the
        beginning of the contour
        ii(R6R
targsortRh(Rt	distancestXXtYYtysizeRbthysizetadisttindRR((sE/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/contour.pytget_label_coords�s	

cC s�tj|�s$|j||�}ntjj|�\}}|dkr�t|d�sitj�|_	n|j	j
||�\}}}np|r�t|d�s�tjd�|_
n|j
j|ddd|j�\}}|j�}nt|�|}|S(s$get the width of the label in pointstTeXt_TeX_managert_mathtext_parsertbitmaptdpiiHtprop(RKtis_string_liketget_textRRtis_math_textthasattrt
texmanagert
TexManagerRstget_text_width_height_descenttmathtexttMathTextParserRttparseR5t	get_widthR((RRTRtfsizetismathRbt_timg((sE/opt/alt/python27/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.
        itaxisiitktrendererN(R
tmeantasarraytaxR�treshapeRRtset_label_propsRytget_window_extenttfiguretcanvasR�tdifftcorners(RRTRR�txxtttbboxRb((sE/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/contour.pytget_real_label_width#s3,cC sA|j|�|j|�|j|j�|j|jj�dS(s0set the label properties - color, fontsize, textN(tset_textt	set_colortset_fontpropertiesR5tset_clip_boxR�R�(RtlabelRtcolor((sE/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/contour.pyR�;s

cC s6tj|�r|St|t�r*||S||SdS(sget the text of the labelN(RKRxt
isinstancetdict(RRTR((sE/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/contour.pyRyBs
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(s�find a good place to plot a label (relatively flat
        part of the contour) and the angle of rotation for the
        text object
        iNii����i(R(R6R
tceiltresizeR�RdtraveltaddtreduceR*tabsRqttupletindex(RR[R\tnsizetxsizeRmRkRltyfirsttylasttxfirsttxlasttstLRSRfRRRptltlctdind((sE/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/contour.pytlocate_labelLs(	((""""")@$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_polygonR
tr_R(tpath_lengthRt
zeros_liket less_simple_linear_interpolationR'R�R�talltarctan2tpiRtarangeR$tisnanR6tfloorR�R-(RtslcRpRbR�tspacingthlwtclosedtpltxitdptlltddtrotationtnlctItxy1txy2((sE/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/contour.pytcalc_label_rot_and_inlineqs\	
"%			%	
$..&6)(c	C sO|jjj�j||f�\}}tj||d|dddd�}|S(NR�thorizontalalignmenttcentertverticalalignment(R�t	transDatatinvertedttransform_pointRR(RRRR�tdxtdyR�((sE/opt/alt/python27/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	R
RR(	RRRR�ttransDataInvR�R�t	drotationR�((sE/opt/alt/python27/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�RyR#R�RFR-RIRDR�t
add_artist(RR�RRRTtcvalueR�t_text((sE/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/contour.pyt
_add_label�scC s2|j|||�}|j|||||�dS(s6
        Addd contour label using Text class.
        N(R�R�(RRRR�RTR�R�((sE/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/contour.pyt	add_label�scC s2|j|||�}|j|||||�dS(s<
        Addd contour label using ClabelText class.
        N(R�R�(RRRR�RTR�R�((sE/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/contour.pytadd_label_clabeltexts	i����cC s0|jj|�|jj|�}|j�dS(s>Defaults to removing last label, but any index can be suppliedN(RItpopRFtremove(RR�R�((sE/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/contour.pyt	pop_labelscC s�|jr|j}n	|j}x�t|j|j|j|j�D]�\}}}}|j|}|j	�}	|j
||j|�}
g}|j�}xAt
|�D]3\}
}|j}|	j|�}tj|�rtj||dd�dd�ff}n|}|j||
�r�|j||
�\}}}|rC|}nd}|j|||
||�\}}||||||�|r�x<|D]1}t|�dkr�|jtj|��q�q�Wq�q�|j|�q�W|r@|2|j|�q@q@WdS(Nii(R%R�R�tzipR2R1R;R?tcollectionsRR�R#t	get_pathsR,tverticest	transformR�R�R
R�RcR�R"R�R(R-tmpathtPathtextend(RRRR�ticonRTR�R�tconRRbt	additionstpathstsegNumtlinepathR�tslc0R�RRRptlcargR�tnewtn((sE/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/contour.pyREsD		
	,	
#N(RRRRXRcRhRqR�R�R�RyR�R"R�R�R�R�R�R�R�RE(((sE/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/contour.pyR1s$	�							
	%i					t
ContourSetcB s�eZdZd�Zd�Zd�Zd�Zd�Zd�Zd�Z	d�Z
d	�Zd
�Zd�Z
d�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 _process_colors method.
    c
O s�||_|jdd!�|_|jdt�|_|jdd!�|_|jdd!�|_|jdd!�|_|jdd!�|_	|jdd!�|_
|jdd!�}|jd	d!�|_|jd
d!�}|jdd�|_|jd
t
�|_|jdd�|_|jdd!�|_t|tj�sPt|jtj�r�t
|_|d!krttj�}n|jdk	r�td��q�n	t|_|j	d!k	r�n|j
d!k	r�n|d!k	r�n|jd!k	r�|d!k	r�td��n|j	dkrtjd|_	n|j||�|j�|jd!k	r�t|j�}|jrk|d8}ntj|jd|�}n|jr�tjd�|_ntjd�|_g|_ g|_!i|d6}|d!k	r�||d
<nt"j#j$||�|j%�|j&�\|_'|_(|jr1|jd!k	rKt)j*d�n|j+�\}}	|j(d!kr�d!gt|j'�|_(nxet,||	|j'|j(�D]�\}
}}}
|j-||
�}|jdd�}tj.|d|jfddd|jd|�}|jj/|�|jj0|�q�Wn�|j1�}||_2|j3�}x�t,|j|||j'�D]~\}
}}}|jdd�}tj4|d|d|d|jd|�}|j5d �|jj/|t�|jj0|�qnW|j6�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
linestylesR�torigintextentRRR R�tneithertantialiasedtnchunkitlocators-extend kwarg does not work yet with log scales"Either colors or cmap must be Nonetimagesimage.originiRscollections.PathCollectionscollections.LineCollections!linewidths is ignored by contourftzordertantialiasedst
edgecolorstnoneit	linestylet
_nolegend_N(7R�R!R"R)R$R�R�R�R�R�R�RR�R'RRRR�tLogNormttickert
LogLocatortlogscaleR/tmpltrcParamst
_process_argst_process_levelsR(R@RKRLR�RFRIRARBt__init__t_process_colorst_get_allsegs_and_allkindstallsegstallkindstwarningstwarnt_get_lowers_and_uppersR�t_make_pathstPathCollectiontadd_collectionR-t_process_linewidthsttlinewidthst_process_linestylestLineCollectiont	set_labeltchanged(RR�RNRORR tncolorstkwtlowerstupperstleveltlevel_uppertsegstkindsR�RtcolRttlinestylestwidthtlstyle((sE/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/contour.pyR`s�,			
	
			


	+			+		
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)RR(R"RR
RYtzmaxRZtzminR$t_autoR�R/R�tminimumtmintmaximumtmaxR'R�tupdate_datalimtautoscale_view(RRNROt
havelimitsR*tsegR5R7((sE/opt/alt/python27/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.
        (RR(R((sE/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/contour.pyRscC 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_levelsR2tcopyR(RR&R'((sE/opt/alt/python27/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+R;tkind((sE/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/contour.pyR/s5cC s�g|j|jd|j�D]}t|�f^q}||_xFt||j�D]2\}}|jrx|j|�qS|j	|�qSWxLt|j
|j�D]5\}}|j|j�|j	|j
j|��q�Wtjj|�dS(NR�(R�R>R�R�ttcolorsR�R�R�t
set_facecolorR�RFRIt	set_alphaR<RARBR#(RtrgbaR@R�t
collectionR�tcv((sE/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/contour.pyR#5s4		"cC s�|jdkrC|jr*tj�|_qCtj|d�|_n|jj�|j}|j}|jj	||�|j�}t
|_|jr�|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"RRR
tMaxNLocatortcreate_dummy_axisR1R2t
set_boundsR'R3R�(RtzRR1R2RT((sE/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/contour.pyt_autolevDs	
				cC s|jrd}nd}t|_|jdkr�t|�dkrW|j|d�}np|d}yFt|�tkr�|j||�}nt	j
|�jt	j�}Wnt
d||f��nX|jr�t|�dkr�td��n||_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(R�R$R3R)R"R(RJR8R6R
R�tastypetfloat64R0R/(RRIRNtfnRTt	level_arg((sE/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/contour.pyt_contour_level_args_s$			
cC s�t|j�|_|jd
krN|jjdt|jd|j�d�n|jdkr�|jjt|jd|j	�d�nt
j|j�|_t
j|j�|_
t
j|j�|_|jdkr�d|jd|jd|_
n|jd
kr(d|jd|jd|_n|jr�d	|jd |jd|_|jdkr�d	|j
|jd|jd<n|jdkr�d	|j|jd|jd<q�n|j|_dS(NtbothR5iiR7i����ii����g�?(RRsmin(RRsmax(RRsmin(RRsmax(RRsmin(RRsmax(R+R)R<R�tinsertR5R2R-R7R1R
R�RZtvminRYtvmaxR�tlayers(R((sE/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/contour.pyRws&-*""	"%cC s|jj|_|jdk	r�dt|j�}}|jrJ|d8}n|jdkrbd}n|jd	kr~|d7}nt||�|_	|j
tj��n|j|_	|j
j�s�|j|j|j�n|jd
kr�t|j
_n|j|j�dS(s�
        Color argument processing for contouring.

        Note that we base the color mapping on the contour levels,
        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
        an extended end layers.
        iiRRR5i����R7N(sbothsmin(sbothsmax(sbothsmaxsmin(Rt
monochromeRR"R(R)R�R�R*R>tset_normRCRVR tscaledtset_climRTRUR$tclipt	set_array(Rti0ti1((sE/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/contour.pyR�s"	
	
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(R�R(R)R"RRRKtiterableR+R6R
R�(RR�tNlevRtnrepstw((sE/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/contour.pyR�s	

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(R�R(R)R"RWRRR1R2R,RKRxR_R+R6R
R�R/(	RR�R`R-tneg_lstepsRSRTRa((sE/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/contour.pyR �s*	
	

cC s|jS(s5returns alpha to be applied to all ContourSet artists(R�(R((sE/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/contour.pyt	get_alpha�scC s||_|j�dS(s%sets alpha for all ContourSet artistsN(R�R#(RR�((sE/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/contour.pyRB�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(sQ
        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�R5RR�tfind(RRRRQtpixeltdmintconmintsegminR_RaR�R�RR�R�R�R�tdsRgtimin((sE/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/contour.pytfind_nearest_contour�s2#

	:N(RRRRRRRRR#RJRQRRRR RfRBR"R'Rn(((sE/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/contour.pyR�Os 	�	*								 				tQuadContourSetcB sJeZdZd�Zd�Zd�Zd�Zd�Zd�ZdZ	RS(s�
    Create and 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 _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(R�R(RR�RNRO((sE/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/contour.pyR7s	cO sCt|dt�re|dj}|jdkrB|dj|_n|dj|_|dj|_n�|j||�\}}}tj	|�}tj
|�}tj	|�}	tj
|�}
|jj||	f||
fg�|jj
dt�tj|�}|tjkrd}ntj|||j�|�}||_dS(s*
        Process args and kwargs.
        iR0N(R�RotCntrR)R"R2R1t
_contour_argsRR4R6R�R8R9R'tgetmasktnomaskt_cntrR�(RRNROtCRRRItx0tx1ty0ty1t_mask((sE/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/contour.pyRBs$
"	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(
R�RR�RpttraceRR(R-R"R)(RRR&R'RR(R)tnlisttnsegR*R+((sE/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/contour.pyR[s$	



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(NRKRLiitdtypeiiis&Too many arguments to %s; see help(%s)R=s,Log scale: values of z <= 0 have been masked(R�R(RR�R
RNt_initialize_x_yt
_check_xyzR0tmasked_invalidR$R6R1R4R2Rtmasked_whereRRR5RQ(RRNROROtNargsRIRR((sE/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/contour.pyRqss*		


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).
        itxdatatydataROR~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_yunitsR
R�RNRtndimR0tshapetmeshgrid(
RRNRORRRItNytNxtnxtny((sE/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/contour.pyR��s*	$

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�?tupperNi����(R�R0R�R�R"R�R
R�R�tlinspaceR9(RRIR�R�RvRwRxRyRRR�R�((sE/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/contour.pyR�s(
"!s�
        :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*, *Y*, and *Z* must be arrays with the same dimensions.

        *Z* may be a masked array, but filled contouring may not
        handle internal masked regions correctly.

        ``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.cm.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.

          *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`.


        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 'solid' is used.

            *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.

            If contour is using a monochrome colormap and the contour
            level is less than 0, then the linestyle specified
            in ``contour.negative_linestyle`` in ``matplotlibrc``
            will be used.

        contourf-only keyword arguments:

          *antialiased*: [ True | False ]
            enable antialiasing

          *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*.

        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
        (
RRRRRRRqR�Rtcontour_doc(((sE/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/contour.pyRo&s					 	�(*Rt
__future__RRt
matplotlibRtnumpyR
Rtmatplotlib._cntrRttmatplotlib.pathtpathR�tmatplotlib.tickerRt
matplotlib.cmRAtmatplotlib.colorsRtmatplotlib.collectionsR�tmatplotlib.font_managerR3tmatplotlib.textRtmatplotlib.cbookRKtmatplotlib.mlabR�tmatplotlib.mathtextRtmatplotlib.texmanagerR|tmatplotlib.blocking_inputRRRRRBR�Ro(((sE/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/contour.pyt<module>s2
�� ��