+
     ]in(  c                   sR   R t ^ RIHt ^ RIt^ RIHtHt ^ RIHt	 ^ RI
Ht ^ RIHt ^ RIHt ^ RIHt ]P(                  R,          tR	 t ! R
 R]4      t]! ]! 4       4      t]! 4       P5                  ]4       ]! ]4      t]! ]4      t]P:                  ! RRRR7      RR l4       tR tR# )a|  
Builtin colormaps, colormap handling utilities, and the `ScalarMappable` mixin.

.. seealso::

  :doc:`/gallery/color/colormap_reference` for a list of builtin colormaps.

  :ref:`colormap-manipulation` for examples of how to make
  colormaps.

  :ref:`colormaps` an in-depth discussion of choosing
  colormaps.

  :ref:`colormapnorms` for more details about data normalization.
)MappingN)_apicolors)_ScalarMappable)datad)cmaps)cmap_familiesz	image.lutc                 s.   / \         Cp \        P                  ! 4        Fr  w  rRV9   d   \        P                  ! W\
        4      MHRV9   d   \        P                  ! VR,          V4      M#\        P                  P                  W\
        4      W&   Kt  	  RRRRRRR	R
/pVP                  4        F%  w  rEW,          P                  4       pWFn	        W`V&   K'  	  \        V P                  4       4       F!  pVP                  4       pWpVP                  &   K#  	  V # )zk
Generate a dict mapping standard colormap names to standard colormaps, as
well as the reversed colormaps.
ZredZlistedZgreyZgrayZ	gist_greyZ	gist_grayZ	gist_yergZ	gist_yargZGraysZGreys)cmaps_listedr   Zitemsr   ZLinearSegmentedColormap_LUTSIZEZListedColormapZ	from_listcopynamelistZvaluesZreversed)Zcmap_dr
   ZspecZaliasesZaliasZoriginal_namecmapZrmaps           4/usr/lib64/python3.14/site-packages/matplotlib/cm.py_gen_cmap_registryr       s    
 Fkkm
 } **4x@ 4 !!$x.$7**44TJ 	 $ 	[[G !($))+	u !0 V]]_%}} tyy & M    c                   sf   a  ] tR t^Bt o RtR tR tR tR tR t	R t
RR	R
R/R ltR tR tRtV tR	# )ColormapRegistrya  
Container for colormaps that are known to Matplotlib by name.

The universal registry instance is `matplotlib.colormaps`. There should be
no need for users to instantiate `.ColormapRegistry` themselves.

Read access uses a dict-like interface mapping names to `.Colormap`\s::

    import matplotlib as mpl
    cmap = mpl.colormaps['viridis']

Returned `.Colormap`\s are copies, so that their modification does not
change the global definition of the colormap.

Additional colormaps can be added via `.ColormapRegistry.register`::

    mpl.colormaps.register(my_colormap)

To get a list of all registered colormaps, you can do::

    from matplotlib import colormaps
    list(colormaps)
c                s2    Wn         \        V4      V n        R # N)_cmapsZtuple_builtin_cmaps)selfr      &&r   __init__ZColormapRegistry.__init__Z   s    #Elr   c                s     V P                   V,          P                  4       #   \         d    \        T: R 24      Rhi ; i)z is not a known colormap nameN)r   r	   ZKeyError)r   Zitemr   r   __getitem__ZColormapRegistry.__getitem__^   sF    	O;;t$))++ 	OdX%BCD$N	Os    # ?c                ,    \        V P                  4      # r   )Ziterr   r      &r   __iter__ZColormapRegistry.__iter__d   s    DKK  r   c                r   r   )Zlenr   r   r   r   __len__ZColormapRegistry.__len__g   s    4;;r   c                s@    R RP                  R V  4       4      ,           # )z'ColormapRegistry; available colormaps:
z, c              3   s.   "   T F  pR V R 2x  K  	  R# 5i)Z'N )Z.0r
      & r   Z	<genexpr>Z+ColormapRegistry.__str__.<locals>.<genexpr>l   s     7$$AdV1+$s   )Zjoinr   r   r   __str__ZColormapRegistry.__str__j   s!    :		7$778 	9r   c                s    \        V 4      # )z
Return a list of the registered colormap names.

This exists only for backward-compatibility in `.pyplot` which had a
``plt.colormaps()`` method. The recommended way to get this list is
now ``list(colormaps)``.
)r   r   r   r   __call__ZColormapRegistry.__call__n   s     Dzr   r
   NforceFc               s   \         P                  ! \        P                  VR7       T;'       g    VP                  pW 9   dS   V'       g   \        RV R24      hW P                  9   d   \        RV: R24      h\         P                  ! RV: R24       VP                  4       V P                  V&   V P                  V,          P                  V8w  d   W P                  V,          n        R# R# )	a  
Register a new colormap.

The colormap name can then be used as a string argument to any ``cmap``
parameter in Matplotlib. It is also available in ``pyplot.get_cmap``.

The colormap registry stores a copy of the given colormap, so that
future changes to the original colormap instance do not affect the
registered colormap. Think of this as the registry taking a snapshot
of the colormap at registration.

Parameters
----------
cmap : matplotlib.colors.Colormap
    The colormap to register.

name : str, optional
    The name for the colormap. If not given, ``cmap.name`` is used.

force : bool, default: False
    If False, a ValueError is raised if trying to overwrite an already
    registered name. True supports overwriting registered colormaps
    other than the builtin colormaps.
r   zA colormap named "z" is already registered.z Re-registering the builtin cmap z is not allowed.zOverwriting the cmap z" that was already in the registry.N)
r   Zcheck_isinstancer   Colormapr
   
ValueErrorr   Zwarn_externalr	   r   )r   r   r
   r!   s   &&$$r   registerZColormapRegistry.registerx   s    2 	fooD9  tyy< !(.FGI I,,, !C$(8+;"= > > !6th ?C  C D !IIKD ;;t!!T)%)KK" *r   c                s~    WP                   9   d   \        RV: R24      hV P                  P                  VR4       R# )a  
Remove a colormap from the registry.

You cannot remove built-in colormaps.

If the named colormap is not registered, returns with no error, raises
if you try to de-register a default colormap.

.. warning::

    Colormap names are currently a shared namespace that may be used
    by multiple packages. Use `unregister` only if you know you
    have registered that name before. In particular, do not
    unregister just in case to clean the name before registering a
    new colormap.

Parameters
----------
name : str
    The name of the colormap to be removed.

Raises
------
ValueError
    If you try to remove a default built-in colormap.
zcannot unregister z which is a builtin colormap.N)r   r$   r   Zpop)r   r
   r   r   
unregisterZColormapRegistry.unregister   s@    6 &&&1$ :) ) * *d#r   c           	     sT   Vf   V \         P                  R,          ,          # \        V\        P                  4      '       d   V# \        V\
        4      '       d.   \        P                  ! \        \        4      VR7       W,          # \        RRV: R\        V4       2,           4      h)a(  
Return a color map specified through *cmap*.

Parameters
----------
cmap : str or `~matplotlib.colors.Colormap` or None

    - if a `.Colormap`, return it
    - if a string, look it up in ``mpl.colormaps``
    - if None, return the Colormap defined in :rc:`image.cmap`

Returns
-------
Colormap

image.cmapr"   z<get_cmap expects None or an instance of a str or Colormap . zyou passed z	 of type )mplrcParams
isinstancer   r#   Zstrr   check_in_listsorted
_colormapsZ	TypeErrorZtype)r   r   r   r   get_cmapZColormapRegistry.get_cmap   s    " <\233 dFOO,,KdC  vj1=:J$4:,78
 	
r   )r   r   )Z__name__Z
__module__Z__qualname__Z__firstlineno____doc__r   r   r   r   r   r    r%   r&   r.   Z__static_attributes__Z__classdictcell__)Z__classdict__s   @r   r   r   B   sM     .+O! 90*T 0* 0*d$@
 
r   r   z3.7z3.11z^``matplotlib.colormaps[name]`` or ``matplotlib.colormaps.get_cmap()`` or ``pyplot.get_cmap()``)ZremovalZalternativec                s    V f   \         P                  R,          p \        V \        P                  4      '       d   V # \
        P                  ! \        \        4      V R7       Vf   \        V ,          # \        V ,          P                  V4      # )a0  
Get a colormap instance, defaulting to rc values if *name* is None.

Parameters
----------
name : `~matplotlib.colors.Colormap` or str or None, default: None
    If a `.Colormap` instance, it will be returned. Otherwise, the name of
    a colormap known to Matplotlib, which will be resampled by *lut*. The
    default, None, means :rc:`image.cmap`.
lut : int or None, default: None
    If *name* is not already a Colormap instance and *lut* is not None, the
    colormap will be resampled to have *lut* entries in the lookup table.

Returns
-------
Colormap
r'   )r
   )
r(   r)   r*   r   r#   r   r+   r,   r-   Z	resampled)r
   Zlutr   r   r.   r.      sh    0 |||L)$((vj)5
{$$))#..r   c                s   \        V \        P                  4      '       d   V # V e   T M\        P                  R,          pV\
        9  d&   \        P                  ! \        \
        4      VR7       \        P                  V,          # )a?  
Ensure that we have a `.Colormap` object.

For internal use to preserve type stability of errors.

Parameters
----------
cmap : None, str, Colormap

    - if a `Colormap`, return it
    - if a string, look it up in mpl.colormaps
    - if None, look up the default color map in mpl.colormaps

Returns
-------
Colormap

r'   r"   )
r*   r   r#   r(   r)   r-   r   r+   r,   Z	colormaps)r   Z	cmap_namer   r   _ensure_cmapr0     s]    & $(((cll<.HI 
"6*-I>==##r   )NN) r/   Zcollections.abcr    Z
matplotlibr(   r   r   Zmatplotlib.colorizerr   ZScalarMappableZmatplotlib._cmr   Zmatplotlib._cm_listedr   r   Zmatplotlib._cm_multivarr   Zmultivar_cmapsZmatplotlib._cm_bivarZbivar_cmapsr)   r   r   r   r-   ZglobalsZupdateZ_multivar_colormapsZ_bivar_colormapsZ
deprecatedr.   r0   r   r   r   <module>r1      s     $  # B   7 C 5 <<$Df
w f
X 023
 	   &~6 #K0  	,//:$r   