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: //proc/self/root/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/cm.pyo
�
�)�Uc@s�dZddlZddlZddlmZddlZddljZddl	j
Z
ddlmZe
�Zd�Zd�ZejdZej�Zx
eD]ZedZeeZd	ekree�ee<ejeee�ee<ejeeee�ee<q�eee��Zeed
�dkrfgeD]\ZZdeef^qAZneee<ejjeee�ee<ejjeee�ee<q�We �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����N(tma(tdatadcs�fd�}|S(Ncs�d|�S(Ni((tx(tf(s@/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/cm.pyt	freverseds((RR((Rs@/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/cm.pyt	_reverserscCs�i}xt|j�D]f\}}t|�r:t|�}n5gt|�D]"\}}}d|||f^qG}|||<qW|S(Ng�?(t	iteritemstcallableRtreversed(tdatatdata_rtkeytvaltvalnewRty0ty1((s@/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/cm.pytrevcmaps5s	image.lutt_rtrediig�?cCs�|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(
tNonetnametAttributeErrort
ValueErrortcbooktis_string_liket
isinstancetcolorstColormaptcmap_dtmpltrcParamstLinearSegmentedColormap(RtcmapR	tlut((s@/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/cm.pyt
register_cmapDs


cCs�|dkrtjd}nt|tj�r2|S|tkr�|dkrRt|S|tkrutj|t||�St	d|��ndS(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(
RRRRRRRRRR(RR!((s@/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/cm.pytget_cmapjstScalarMappablecBs�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
    cCs�tjd�|_|dkr*t�}n|dkrEtj�}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`
        tchangedtarrayN(schanged(
RtCallbackRegistrytcallbacksSMRR#Rt	Normalizet_AtnormR tcolorbartFalsetupdate_dict(tselfR+R ((s@/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/cm.pyt__init__�s			cCs||f|_dS(s8set the colorbar image and axes associated with mappableN(R,(R/timtax((s@/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/cm.pytset_colorbar�scCs�|dkrd}n|}y/|jdkrI|jddkr�|jtjkrntj|dtj�}n|jd \}}tjd||dfd|j�}||dd�dd�dd�f<||dd�dd�df<n(|jddkr|}ntd	��|rE|jtjkrE|dj	tj�}n|SWnt
k
r]nXtj|�}|j
|�}|j|d
|d|�}|S(s�Return a normalized rgba array corresponding to *x*. If *x*
        is already an rgb array, insert *alpha*; if it is already
        rgba, return it unchanged. If *bytes* is True, return rgba as
        4 uint8s instead of 4 floats.
        g�?iii�tshapeitdtypeNsthird dimension must be 3 or 4talphatbytes(RtndimR4R5tnptuint8R&temptyRtastypeRRtasarrayR+R (R/RR6R7t_alphatmtntxx((s@/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/cm.pytto_rgba�s0	$%"	
cCs||_t|jd<dS(s(Set the image array from numpy array *A*R&N(R*tTrueR.(R/tA((s@/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/cm.pyt	set_array�s	cCs|jS(sReturn the array(R*(R/((s@/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/cm.pyt	get_array�scCs|jS(sreturn the colormap(R (R/((s@/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/cm.pyR#�scCs|jj|jjfS(s9return the min, max of the color limits for image scaling(R+tvmintvmax(R/((s@/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/cm.pytget_clim�scCs�|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(RRtiterabletlenR+RGRHR%(R/RGRH((s@/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/cm.pytset_clim�s!cCs#t|�}||_|j�dS(sn
        set the colormap for luminance data

        ACCEPTS: a colormap or registered colormap name
        N(R#R R%(R/R ((s@/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/cm.pytset_cmap�s	cCs2|dkrtj�}n||_|j�dS(sset the normalization instanceN(RRR)R+R%(R/R+((s@/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/cm.pytset_norm�s	cCs?|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(R*Rt	TypeErrorR+t	autoscaleR%(R/((s@/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/cm.pyRP�scCs?|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(R*RROR+tautoscale_NoneR%(R/((s@/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/cm.pyRQscCst|j|<dS(sz
        Add an entry to a dictionary of boolean flags
        that are set to True when the mappable is changed.
        N(R-R.(R/tchecker((s@/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/cm.pytadd_checkerscCs"|j|rt|j|<tStS(sf
        If mappable has changed since the last check,
        return True; else return False
        (R.R-RC(R/RR((s@/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/cm.pytcheck_updates

cCs8|jjd|�x|jD]}t|j|<qWdS(s�
        Call this whenever the mappable is changed to notify all the
        callbackSM listeners to the 'changed' signal
        R%N(R(tprocessR.RC(R/R((s@/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/cm.pyR%sN(t__name__t
__module__t__doc__RR0R3R-RBRERFR#RIRLRMRNRPRQRSRTR%(((s@/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/cm.pyR$�s 	!					
		
			
((&RXtostnumpyR9Rt
matplotlibRtmatplotlib.colorsRtmatplotlib.cbookRtmatplotlib._cmRtdictRRRRtLUTSIZEtkeyst
_cmapnamestcmapnamet
cmapname_rtcmapspecRtlistRtrevspecRKtatbt	from_listtlocalstupdateRR"R#R$(((s@/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/cm.pyt<module>sB			



,
		&