intellecton/venv/lib/python3.12/site-packages/matplotlib/__pycache__/cm.cpython-312.pyc

174 lines
12 KiB
Text
Raw Normal View History

<EFBFBD>
<00>Rjn(<00><00>F<00>dZddlmZddlZddlmZmZddlmZ ddl
m Z ddl m ZddlmZddlm Zej(d Zd
<EFBFBD>ZGd <0B>d e<02>Zee<16><00>Ze<19>j5e<18>ee<11>Zee<13>Zej:d dd<0F><10>dd<11><01>Zd<12>Zy)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.
<EFBFBD>)<01>MappingN)<02>_api<70>colors)<01>_ScalarMappable)<01>datad)<01>cmaps)<01> cmap_familiesz image.lutc<00> <00>it<00>}tj<00>D]i\}}d|vrtj||t
<00>nAd|vrtj |d|<01>n$tjj||t
<00>||<<00>kddddd<07>}|j<00>D]$\}}||j<00>}||_ |||<<00>&t|j<00><00>D]!}|j<00>}|||j<<00>#|S)zw
Generate a dict mapping standard colormap names to standard colormaps, as
well as the reversed colormaps.
<20>red<65>listed<65>gray<61> gist_gray<61> gist_yarg<72>Greys)<04>grey<65> gist_grey<65> gist_yerg<72>Grays) <0A> cmaps_listedr<00>itemsr<00>LinearSegmentedColormap<61>_LUTSIZE<5A>ListedColormap<61> from_list<73>copy<70>name<6D>list<73>values<65>reversed)<08>cmap_dr<00>spec<65>aliases<65>alias<61> original_name<6D>cmap<61>rmaps <20>P/home/antigravity/intellecton/venv/lib/python3.12/site-packages/matplotlib/cm.py<70>_gen_cmap_registryr( s<00><00>
<1E> <0C> <1D>F<EFBFBD><1B>k<EFBFBD>k<EFBFBD>m<EFBFBD>L<01>
<EFBFBD><04>d<EFBFBD><15><04>}<7D> <13> *<2A> *<2A>4<EFBFBD><14>x<EFBFBD> @<40><18>4<EFBFBD><1F> <13> !<21> !<21>$<24>x<EFBFBD>.<2E>$<24> 7<> <12> *<2A> *<2A> 4<> 4<>T<EFBFBD>4<EFBFBD><18> J<> <0F>t<EFBFBD> <0C>L<01><17> <20> <20><18> <06>G<EFBFBD>!(<28> <0A> <0A><0F><1D><1C><05>}<7D><15>m<EFBFBD>$<24>)<29>)<29>+<2B><04><19><04> <09><1C><06>u<EFBFBD> <0A><1D> <15>V<EFBFBD>]<5D>]<5D>_<EFBFBD>%<25>!<21><04><13>}<7D>}<7D><EFBFBD><04> <20><06>t<EFBFBD>y<EFBFBD>y<EFBFBD><19>!<21> <12>M<EFBFBD>c<00>N<00>eZdZdZd<02>Zd<03>Zd<04>Zd<05>Zd<06>Zd<07>Z dd d
<EFBFBD>d <0B>Z
d <0C>Z d <0A>Z y)<0E>ColormapRegistrya<79>
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<00>2<00>||_t|<01>|_y<00>N)<03>_cmaps<70>tuple<6C>_builtin_cmaps)<02>selfrs r'<00>__init__zColormapRegistry.__init__Zs<00><00><1B><04> <0B>#<23>E<EFBFBD>l<EFBFBD><04>r)c<00>v<00> |j|j<00>S#t$rt|<01>d<01><02>d<00>wxYw)Nz is not a known colormap name)r.r<00>KeyError)r1<00>items r'<00> __getitem__zColormapRegistry.__getitem__^sF<00><00> O<01><17>;<3B>;<3B>t<EFBFBD>$<24>)<29>)<29>+<2B> +<2B><><17> O<01><1A>d<EFBFBD>X<EFBFBD>%B<>C<>D<>$<24> N<> O<01>s<00><00>8c<00>,<00>t|j<00>Sr-)<02>iterr.<00>r1s r'<00>__iter__zColormapRegistry.__iter__ds<00><00><13>D<EFBFBD>K<EFBFBD>K<EFBFBD> <20> r)c<00>,<00>t|j<00>Sr-)<02>lenr.r9s r'<00>__len__zColormapRegistry.__len__gs<00><00><12>4<EFBFBD>;<3B>;<3B><1F>r)c<00>8<00>ddjd<03>|D<00><00>zS)Nz'ColormapRegistry; available colormaps:
z, c3<00>(K<00>|]
}d|<01>d<00><03><01><00> y<01>w)<02>'N<>)<02>.0rs r'<00> <genexpr>z+ColormapRegistry.__str__.<locals>.<genexpr>ls<00><00><><00>7<>$<24>A<EFBFBD>d<EFBFBD>V<EFBFBD>1<EFBFBD>+<2B>7<>s<00>)<01>joinr9s r'<00>__str__zColormapRegistry.__str__js!<00><00>:<3A><14> <09> <09>7<>$<24>7<>7<>8<> 9r)c<00><00>t|<00>S)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)``.
)rr9s r'<00>__call__zColormapRegistry.__call__ns<00><00><14>D<EFBFBD>z<EFBFBD>r)NF)r<00>forcec<00><><00>tjtj|<01><01>|xs |j}||vrG|st d|<02>d<03><03><00>||j vrt d|<02>d<05><03><00>tjd|<02>d<07><03>|j<00>|j|<|j|j|k7r||j|_yy) 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.
<20>r%zA colormap named "z" is already registered.z Re-registering the builtin cmap z is not allowed.zOverwriting the cmap z" that was already in the registry.N)
r<00>check_isinstancer<00>Colormapr<00>
ValueErrorr0<00> warn_externalrr.)r1r%rrHs r'<00>registerzColormapRegistry.registerxs<><00><00>2 <0A><1D><1D>f<EFBFBD>o<EFBFBD>o<EFBFBD>D<EFBFBD>9<><13> <20>t<EFBFBD>y<EFBFBD>y<EFBFBD><04> <0F>4<EFBFBD><<3C><18>!<21>(<28><14><06>.F<>G<>I<01>I<01><15><14>,<2C>,<2C>,<2C> <20>!C<>$(<28>8<EFBFBD>+;<3B>"=<3D>><3E>><3E> <11> <1E> <1E>!6<>t<EFBFBD>h<EFBFBD>?C<01> C<01> D<01>!<21>I<EFBFBD>I<EFBFBD>K<EFBFBD><04> <0B> <0B>D<EFBFBD><19> <10>;<3B>;<3B>t<EFBFBD> <1C> !<21> !<21>T<EFBFBD> )<29>%)<29>D<EFBFBD>K<EFBFBD>K<EFBFBD><04> <1D> "<22> *r)c<00>v<00>||jvrtd|<01>d<02><03><00>|jj|d<03>y)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.
zcannot unregister z which is a builtin colormap.N)r0rMr.<00>pop)r1rs r'<00>
unregisterzColormapRegistry.unregister<65>sB<00><00>6 <10>4<EFBFBD>&<26>&<26> &<26><1C>1<>$<24><18>:)<29>)<29>*<2A> *<2A> <0C> <0B> <0B><0F><0F><04>d<EFBFBD>#r)c <00><00>|<01>|tjdSt|tj<00>r|St|t
<00>r)t jtt<00>|<01><02>||Stdd|<01>dt|<01><00><00>z<00><00>)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
<20>
image.cmaprJz<get_cmap expects None or an instance of a str or Colormap . z you passed z of type ) <0C>mpl<70>rcParams<6D>
isinstancerrL<00>strr<00> check_in_list<73>sorted<65>
_colormaps<EFBFBD> TypeError<6F>type)r1r%s r'<00>get_cmapzColormapRegistry.get_cmap<61>s<><00><00>" <10><<3C><17><03> <0C> <0C>\<5C>2<>3<> 3<> <16>d<EFBFBD>F<EFBFBD>O<EFBFBD>O<EFBFBD> ,<2C><17>K<EFBFBD> <15>d<EFBFBD>C<EFBFBD> <20> <10> <1E> <1E>v<EFBFBD>j<EFBFBD>1<><04> =<3D><17><04>:<3A> <1D><17> J<><19>$<24><18><19>4<EFBFBD><04>:<3A>,<2C> 7<> 8<>
<EFBFBD>
r)) <0A>__name__<5F>
__module__<EFBFBD> __qualname__<5F>__doc__r2r6r:r=rErGrOrRr^rAr)r'r+r+Bs><00><00><08>.+<2B>O<01> !<21> <20>9<><1A>&*<2A><15>0*<2A>d$<24>@
r)r+z3.7z3.11z^``matplotlib.colormaps[name]`` or ``matplotlib.colormaps.get_cmap()`` or ``pyplot.get_cmap()``)<02>removal<61> alternativec<00><><00>|<00>tjd}t|tj<00>r|St j tt<00>|<00><02>|<01> t|St|j|<01>S)ah
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
rT)r)
rUrVrWrrLrrYrZr[<00> resampled)r<00>luts r'r^r^<00>se<00><00>0 <0C>|<7C><12>|<7C>|<7C>L<EFBFBD>)<29><04><11>$<24><06><0F><0F>(<28><13> <0B><08><16><16>v<EFBFBD>j<EFBFBD>)<29><04>5<>
<EFBFBD>{<7B><19>$<24><1F><1F><19>$<24><1F>)<29>)<29>#<23>.<2E>.r)c<00><><00>t|tj<00>r|S|<00>|ntjd}|t
vr$t jtt
<00>|<01><02>tj|S)ao
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
rTrJ)
rWrrLrUrVr[rrYrZ<00> colormaps)r%<00> cmap_names r'<00> _ensure_cmaprksZ<00><00>&<12>$<24><06><0F><0F>(<28><13> <0B><1C>(<28><04>c<EFBFBD>l<EFBFBD>l<EFBFBD><<3C>.H<>I<EFBFBD><11>
<EFBFBD>"<22> <0C><1A><1A>6<EFBFBD>*<2A>-<2D>I<EFBFBD>><3E> <0E>=<3D>=<3D><19> #<23>#r))NN) rb<00>collections.abcr<00>
matplotlibrUrr<00>matplotlib.colorizerr<00>ScalarMappable<6C>matplotlib._cmr<00>matplotlib._cm_listedrr<00>matplotlib._cm_multivarr <00>multivar_cmaps<70>matplotlib._cm_bivar<61> bivar_cmapsrVrr(r+r[<00>globals<6C>update<74>_multivar_colormaps<70>_bivar_colormaps<70>
deprecatedr^rkrAr)r'<00><module>r{s<><00><01><04> $<24><18>#<23>B<> <20>7<>C<>5<> <0F><<3C><<3C> <0B> $<24><08><12>Df
<EFBFBD>w<EFBFBD>f
<EFBFBD>X<1E>0<>2<> 3<>
<EFBFBD><07> <09><10><10><1A><1C>&<26>~<7E>6<><13>#<23>K<EFBFBD>0<><10> <11><14><1F><1F> <09> <12>,<2C><06> /<2F> <06> /<2F>:$r)