MCPcopy Index your code
hub / github.com/matplotlib/matplotlib / unregister

Method unregister

lib/matplotlib/cm.py:168–198  ·  view source on GitHub ↗

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

(self, name)

Source from the content-addressed store, hash-verified

166 self._cmaps[name].name = name
167
168 def unregister(self, name):
169 """
170 Remove a colormap from the registry.
171
172 You cannot remove built-in colormaps.
173
174 If the named colormap is not registered, returns with no error, raises
175 if you try to de-register a default colormap.
176
177 .. warning::
178
179 Colormap names are currently a shared namespace that may be used
180 by multiple packages. Use `unregister` only if you know you
181 have registered that name before. In particular, do not
182 unregister just in case to clean the name before registering a
183 new colormap.
184
185 Parameters
186 ----------
187 name : str
188 The name of the colormap to be removed.
189
190 Raises
191 ------
192 ValueError
193 If you try to remove a default built-in colormap.
194 """
195 if name in self._builtin_cmaps:
196 raise ValueError(f"cannot unregister {name!r} which is a builtin "
197 "colormap.")
198 self._cmaps.pop(name, None)
199
200 def get_cmap(self, cmap):
201 """

Callers 3

test_color_sequencesFunction · 0.45

Calls 1

popMethod · 0.45

Tested by 1

test_color_sequencesFunction · 0.36