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/cm.pyo
�
r`]c@ s~dZddlmZmZddlZddlZddlmZddlZ	ddl
jZddlj
Z
ddlmZddlmZe�Zd�Zd�Zd	�Zd
�Ze	jdZej�Zx2eD]*ZeeZee�Zeeed<q�Wx'ej�D]Zeee�ee<qWe�j e�ddddd
�Z"ddd�Z#ddd��YZ$dS(s�
This module provides a large set of colormaps, functions for
registering new colormaps and for getting a colormap by name,
and a mixin class for adding color mapping functionality.

i����(tprint_functiontdivisionN(tma(tdatad(t	cubehelixc s�fd�}|S(Nc s�d|�S(Ni((tx(tf(s3/usr/lib64/python2.7/site-packages/matplotlib/cm.pyt	freverseds((RR((Rs3/usr/lib64/python2.7/site-packages/matplotlib/cm.pyt	_reverserscC s�i}xt|j�D]f\}}t|�r:t|�}n5gt|�D]"\}}}d|||f^qG}|||<qW|S(s:Can only handle specification *data* in dictionary format.g�?(t	iteritemstcallableRtreversed(tdatatdata_rtkeytvaltvalnewRty0ty1((s3/usr/lib64/python2.7/site-packages/matplotlib/cm.pytrevcmaps5cC srd|krt|�Stt|��}t|d�dkrjg|D]\}}d||f^qE}n|SdS(sRReverses cmap specification *spec*, can handle both dict and tuple
    type specs.trediig�?N(RtlistRtlen(tspectrevspectatb((s3/usr/lib64/python2.7/site-packages/matplotlib/cm.pyt_reverse_cmap_spec-s
,cC sCt|}d|kr)tj|||�Stjj|||�SdS(sSGenerates the requested cmap from it's name *name*.  The lut size is
    *lutsize*.RN(RtcolorstLinearSegmentedColormapt	from_list(tnametlutsizeR((s3/usr/lib64/python2.7/site-packages/matplotlib/cm.pyt_generate_cmap9s
s	image.lutt_rcC s�|dkr<y
|j}Wq<tk
r8td��q<Xntj|�sZtd��nt|tj�rz|t	|<dS|dkr�t
jd}ntj|||�}|t	|<dS(s7
    Add a colormap to the set recognized by :func:`get_cmap`.

    It can be used in two ways::

        register_cmap(name='swirly', cmap=swirly_cmap)

        register_cmap(name='choppy', data=choppydata, lut=128)

    In the first case, *cmap* must be a :class:`colors.Colormap`
    instance.  The *name* is optional; if absent, the name will
    be the :attr:`name` attribute of the *cmap*.

    In the second case, the three arguments are passed to
    the :class:`colors.LinearSegmentedColormap` initializer,
    and the resulting colormap is registered.

    s+Arguments must include a name or a ColormapsColormap name must be a stringNs	image.lut(
tNoneRtAttributeErrort
ValueErrortcbooktis_string_liket
isinstanceRtColormaptcmap_dtmpltrcParamsR(RtcmapRtlut((s3/usr/lib64/python2.7/site-packages/matplotlib/cm.pyt
register_cmapZs


cC s�|dkrtjd}nt|tj�r2|S|tkrn|dkrRt|S|tkrnt||�Snt	d|��dS(s�
    Get a colormap instance, defaulting to rc values if *name* is None.

    Colormaps added with :func:`register_cmap` take precedence over
    builtin colormaps.

    If *name* is a :class:`colors.Colormap` instance, it will be
    returned.

    If *lut* is not None it must be an integer giving the number of
    entries desired in the lookup table, and *name* must be a
    standard mpl colormap name with a corresponding data dictionary
    in *datad*.
    s
image.cmapsColormap %s is not recognizedN(
R#R+R,R(RR)R*RR!R%(RR.((s3/usr/lib64/python2.7/site-packages/matplotlib/cm.pytget_cmap�stScalarMappablecB s�eZdZddd�Zd�Zded�Zd�Zd�Z	d�Z
d�Zddd�Zd	�Z
d
�Zd�Zd�Zd
�Zd�Zd�ZRS(sn
    This is a mixin class to support scalar -> RGBA mapping.  Handles
    normalization and colormapping
    cC s�tj�|_|dkr't�}n|dkrBtj�}nd|_||_t|�|_	d|_
itd6|_dS(s�
        *norm* is an instance of :class:`colors.Normalize` or one of
        its subclasses, used to map luminance to 0-1. *cmap* is a
        :mod:`cm` colormap instance, for example :data:`cm.jet`
        tarrayN(
R&tCallbackRegistrytcallbacksSMR#R0Rt	Normalizet_AtnormR-tcolorbartFalsetupdate_dict(tselfR7R-((s3/usr/lib64/python2.7/site-packages/matplotlib/cm.pyt__init__�s			cC s||f|_dS(s8set the colorbar image and axes associated with mappableN(R8(R;timtax((s3/usr/lib64/python2.7/site-packages/matplotlib/cm.pytset_colorbar�scC s�ym|jdkrl|jddkr�|dkr:d}n|jtjkrbtj|d�}n|jd \}}tjd||dfd|j�}||dd�dd�dd�f<||dd�dd�df<n(|jddkr�|}ntd	��|r9|jtjkr9|djtj�}n|rh|jtjkrh|jt	�d}n|SWnt
k
r�nXtj|�}|j
|�}|j|d
|d|�}|S(sx
        Return a normalized rgba array corresponding to *x*.

        In the normal case, *x* is a 1-D or 2-D sequence of scalars, and
        the corresponding ndarray of rgba values will be returned,
        based on the norm and colormap set for this ScalarMappable.

        There is one special case, for handling images that are already
        rgb or rgba, such as might have been read from an image file.
        If *x* is an ndarray with 3 dimensions,
        and the last dimension is either 3 or 4, then it will be
        treated as an rgb or rgba array, and no mapping will be done.
        If the last dimension is 3, the *alpha* kwarg (defaulting to 1)
        will be used to fill in the transparency.  If the last dimension
        is 4, the *alpha* kwarg is ignored; it does not
        replace the pre-existing alpha.  A ValueError will be raised
        if the third dimension is other than 3 or 4.

        In either case, if *bytes* is *False* (default), the rgba
        array will be floats in the 0-1 range; if it is *True*,
        the returned rgba array will be uint8 in the 0 to 255 range.

        Note: this method assumes the input is well-behaved; it does
        not check for anomalies such as *x* being a masked rgba
        array, or being an integer type other than uint8, or being
        a floating point rgba array with values outside the 0-1 range.
        iiii�tshapeitdtypeNsthird dimension must be 3 or 4talphatbytes(tndimR@R#RAtnptuint8temptyR%tastypetfloatR$RtasarrayR7R-(R;RRBRCtmtntxx((s3/usr/lib64/python2.7/site-packages/matplotlib/cm.pytto_rgba�s2	$%"	
cC s||_t|jd<dS(s(Set the image array from numpy array *A*R2N(R6tTrueR:(R;tA((s3/usr/lib64/python2.7/site-packages/matplotlib/cm.pyt	set_array�s	cC s|jS(sReturn the array(R6(R;((s3/usr/lib64/python2.7/site-packages/matplotlib/cm.pyt	get_array�scC s|jS(sreturn the colormap(R-(R;((s3/usr/lib64/python2.7/site-packages/matplotlib/cm.pyR0�scC s|jj|jjfS(s9return the min, max of the color limits for image scaling(R7tvmintvmax(R;((s3/usr/lib64/python2.7/site-packages/matplotlib/cm.pytget_climscC s�|dk	rH|dkrHtj|�rHt|�dkrH|\}}n|dk	rc||j_n|dk	r~||j_n|j�dS(s�
        set the norm limits for image scaling; if *vmin* is a length2
        sequence, interpret it as ``(vmin, vmax)`` which is used to
        support setp

        ACCEPTS: a length 2 sequence of floats
        iN(R#R&titerableRR7RSRTtchanged(R;RSRT((s3/usr/lib64/python2.7/site-packages/matplotlib/cm.pytset_clims!cC s#t|�}||_|j�dS(sn
        set the colormap for luminance data

        ACCEPTS: a colormap or registered colormap name
        N(R0R-RW(R;R-((s3/usr/lib64/python2.7/site-packages/matplotlib/cm.pytset_cmaps	cC s2|dkrtj�}n||_|j�dS(sset the normalization instanceN(R#RR5R7RW(R;R7((s3/usr/lib64/python2.7/site-packages/matplotlib/cm.pytset_norms	cC s?|jdkrtd��n|jj|j�|j�dS(sb
        Autoscale the scalar limits on the norm instance using the
        current array
        s%You must first set_array for mappableN(R6R#t	TypeErrorR7t	autoscaleRW(R;((s3/usr/lib64/python2.7/site-packages/matplotlib/cm.pyR\%scC s?|jdkrtd��n|jj|j�|j�dS(s�
        Autoscale the scalar limits on the norm instance using the
        current array, changing only limits that are None
        s%You must first set_array for mappableN(R6R#R[R7tautoscale_NoneRW(R;((s3/usr/lib64/python2.7/site-packages/matplotlib/cm.pyR]/scC st|j|<dS(sz
        Add an entry to a dictionary of boolean flags
        that are set to True when the mappable is changed.
        N(R9R:(R;tchecker((s3/usr/lib64/python2.7/site-packages/matplotlib/cm.pytadd_checker:scC s"|j|rt|j|<tStS(sf
        If mappable has changed since the last check,
        return True; else return False
        (R:R9RO(R;R^((s3/usr/lib64/python2.7/site-packages/matplotlib/cm.pytcheck_updateAs

cC s8|jjd|�x|jD]}t|j|<qWdS(s�
        Call this whenever the mappable is changed to notify all the
        callbackSM listeners to the 'changed' signal
        RWN(R4tprocessR:RO(R;R((s3/usr/lib64/python2.7/site-packages/matplotlib/cm.pyRWKsN(t__name__t
__module__t__doc__R#R<R?R9RNRQRRR0RURXRYRZR\R]R_R`RW(((s3/usr/lib64/python2.7/site-packages/matplotlib/cm.pyR1�s 	;					
		
			
((%Rdt
__future__RRtostnumpyRERt
matplotlibR+tmatplotlib.colorsRtmatplotlib.cbookR&tmatplotlib._cmRRtdictR*RRRR!R,tLUTSIZEtkeyst
_cmapnamestcmapnameRt
spec_reversedtiterkeystlocalstupdateR#R/R0R1(((s3/usr/lib64/python2.7/site-packages/matplotlib/cm.pyt<module>s4					


&

Anon7 - 2021