Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit a987e31

Browse filesBrowse files
committed
API: accept that pyplot.get_cmap is not going away
Add it to the rendered docs.
1 parent 08ac800 commit a987e31
Copy full SHA for a987e31

File tree

Expand file treeCollapse file tree

3 files changed

+5
-2
lines changed
Filter options
Expand file treeCollapse file tree

3 files changed

+5
-2
lines changed

‎doc/api/next_api_changes/deprecations/23668-TC.rst

Copy file name to clipboardExpand all lines: doc/api/next_api_changes/deprecations/23668-TC.rst
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,4 +19,4 @@ following functions have been marked for pending deprecation:
1919
- `matplotlib.cm.unregister_cmap` - use ``matplotlib.colormaps.unregister`` instead
2020
- ``matplotlib.pyplot.register_cmap`` - use ``matplotlib.colormaps.register`` instead
2121

22-
The ``matplotlib.pyplot.get_cmap`` function will stay available for backward compatibility.
22+
The `matplotlib.pyplot.get_cmap` function will stay available for backward compatibility.

‎doc/api/pyplot_summary.rst

Copy file name to clipboardExpand all lines: doc/api/pyplot_summary.rst
+1Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,7 @@ Plotting commands
6464
gcf
6565
gci
6666
get
67+
get_cmap
6768
get_figlabels
6869
get_fignums
6970
getp

‎lib/matplotlib/pyplot.py

Copy file name to clipboardExpand all lines: lib/matplotlib/pyplot.py
+3-1Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2022,7 +2022,7 @@ def get_plot_commands():
20222022
# This works by searching for all functions in this module and removing
20232023
# a few hard-coded exclusions, as well as all of the colormap-setting
20242024
# functions, and anything marked as private with a preceding underscore.
2025-
exclude = {'colormaps', 'colors', 'get_plot_commands', 'get_cmap',
2025+
exclude = {'colormaps', 'colors', 'get_plot_commands',
20262026
*_NON_PLOT_COMMANDS, *colormaps}
20272027
this_module = inspect.getmodule(get_plot_commands)
20282028
return sorted(
@@ -2069,6 +2069,8 @@ def clim(vmin=None, vmax=None):
20692069
im.set_clim(vmin, vmax)
20702070

20712071

2072+
# eventually this implementation should move here, use indirection for now to
2073+
# avoid having two copies of the code floating around.
20722074
def get_cmap(name=None, lut=None):
20732075
return cm._get_cmap(name=name, lut=lut)
20742076
get_cmap.__doc__ = cm._get_cmap.__doc__

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.