|
1 | | -``matplotlib.cm.register_cmap`` |
2 | | -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
| 1 | +In Matplotlib 3.5 we added a `.ColormapRegistry` class and exposed an instance |
| 2 | +at the top level as ``matplotlib.colormaps``. The existing top level functions |
| 3 | +in `matplotlib.cm` (``get_cmap``, ``register_cmap``, ``unregister_cmap``) were |
| 4 | +changed to be aliases around the same instance. In Matplotlib 3.6 we have |
| 5 | +marked those top level functions as pending deprecation. |
3 | 6 |
|
4 | | -... was removed as it was deprecated during 3.7. Use `matplotlib.colormaps.register` instead. |
| 7 | +In Matplotlib 3.7, the following functions have been marked for deprecation: |
5 | 8 |
|
6 | | -``matplotlib.cm.unregister_cmap`` |
7 | | -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
| 9 | +- ``matplotlib.cm.get_cmap``; use ``matplotlib.colormaps[name]`` instead if you |
| 10 | + have a `str`. |
8 | 11 |
|
9 | | -... was removed as it was deprecated during 3.7. Use `matplotlib.colormaps.unregister` instead. |
| 12 | + **Added 3.6.1** Use `matplotlib.cm.ColormapRegistry.get_cmap` if you |
| 13 | + have a string, `None` or a `matplotlib.colors.Colormap` object that you want |
| 14 | + to convert to a `matplotlib.colors.Colormap` instance. |
| 15 | +- ``matplotlib.cm.register_cmap``; use `matplotlib.colormaps.register |
| 16 | + <.ColormapRegistry.register>` instead |
| 17 | +- ``matplotlib.cm.unregister_cmap``; use `matplotlib.colormaps.unregister |
| 18 | + <.ColormapRegistry.unregister>` instead |
| 19 | +- ``matplotlib.pyplot.register_cmap``; use `matplotlib.colormaps.register |
| 20 | + <.ColormapRegistry.register>` instead |
10 | 21 |
|
11 | | -``matplotlib.pyplot.register_cmap`` |
12 | | -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
13 | | - |
14 | | -... was removed as it was deprecated during 3.7. Use `matplotlib.colormaps.register` instead. |
15 | | - |
16 | | -``matplotlib.cm.get_cmap`` |
17 | | -~~~~~~~~~~~~~~~~~~~~~~~~~~ |
18 | | - |
19 | | -... was removed as it was deprecated during 3.7. Use `matplotlib.cm.ColormapRegistry.get_cmap` if you have a string, `None` |
20 | | -or a `matplotlib.colors.Colormap` object that you want to convert to a `matplotlib.colors.Colormap` instance. |
| 22 | +The `matplotlib.pyplot.get_cmap` function will stay available for backward |
| 23 | +compatibility. |
0 commit comments