| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,18 +1,22 @@ | ||
| Colormap registry | ||
| ------------------ | ||
| Colormap registry (experimental) | ||
| -------------------------------- | ||
|
|
||
| Colormaps are now managed via `matplotlib.colormaps`, which is a | ||
| `.ColormapRegistry`. | ||
| Colormaps are now managed via `matplotlib.colormaps` (or `.pyplot.colormaps`), | ||
| which is a `.ColormapRegistry`. While we are confident that the API is final, | ||
| we formally mark it as experimental for 3.5 because we want to keep the option | ||
| to still adapt the API for 3.6 should the need arise. | ||
|
|
||
| Colormaps can be obtained using item access:: | ||
|
|
||
| import matplotlib as mpl | ||
| cmap = mpl.colormaps['viridis'] | ||
| import matplotlib.pyplot as plt | ||
| cmap = plt.colormaps['viridis'] | ||
|
|
||
| To register new colormaps use:: | ||
|
|
||
| mpl.colormaps.register(my_colormap) | ||
| plt.colormaps.register(my_colormap) | ||
|
|
||
| The use of `matplotlib.cm.get_cmap` and `matplotlib.cm.register_cmap` is | ||
| discouraged in favor of the above. Within `.pyplot` the use of | ||
| ``plt.get_cmap()`` and ``plt.register_cmap()`` will continue to be supported. | ||
| We recommend to use the new API instead of the `~.cm.get_cmap` and | ||
| `~.cm.register_cmap` functions for new code. `matplotlib.cm.get_cmap` and | ||
| `matplotlib.cm.register_cmap` will eventually be deprecated and removed. | ||
| Within `.pyplot` ``plt.get_cmap()`` and ``plt.register_cmap()`` will continue | ||
| to be supported for backward compatibility. | ||
| Back | FazBrowse Home | New Git URL |
Uh oh!
There was an error while loading. Please reload this page.