Skip to content

Commit 948295a

Browse files
committed
DOC: Discouraged duplicate colormaps
Closes matplotlib#30796. State that the use of the colormaps gist_gray, grist_yarg, binary is discouraged. To be clear: We don't have a plan to depreacte them. Even though I've decided to remove them from the plotting and only mention them by name in the admonition to de-emphasize them in the docs and push towards the recommended alternatives.
1 parent 89aa371 commit 948295a

File tree

2 files changed

+35
-4
lines changed

2 files changed

+35
-4
lines changed

galleries/examples/color/colormap_reference.py

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
'YlOrBr', 'YlOrRd', 'OrRd', 'PuRd', 'RdPu', 'BuPu',
2525
'GnBu', 'PuBu', 'YlGnBu', 'PuBuGn', 'BuGn', 'YlGn']),
2626
('Sequential (2)', [
27-
'binary', 'gist_yarg', 'gist_gray', 'gray', 'bone', 'pink',
27+
'gray', 'bone', 'pink',
2828
'spring', 'summer', 'autumn', 'winter', 'cool', 'Wistia',
2929
'hot', 'afmhot', 'gist_heat', 'copper']),
3030
('Diverging', [
@@ -70,6 +70,22 @@ def plot_color_gradients(cmap_category, cmap_list):
7070

7171

7272
# %%
73+
#
74+
# .. admonition:: Discouraged
75+
#
76+
# For backward compatibility we additionally support the following colormap
77+
# names, which are identical to other builtin colormaps. Their use is
78+
# discouraged. Use the suggested replacement instead.
79+
#
80+
# ========= =================================
81+
# Colormap Use identical replacement instead
82+
# ========= =================================
83+
# gist_gray gray
84+
# gist_yarg gray_r
85+
# binary gray_r
86+
# ========= =================================
87+
#
88+
#
7389
# .. _reverse-cmap:
7490
#
7591
# Reversed colormaps

galleries/users_explain/colors/colormaps.py

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -161,11 +161,26 @@ def plot_color_gradients(category, cmap_list):
161161
# an excellent example of this).
162162

163163
plot_color_gradients('Sequential (2)',
164-
['binary', 'gist_yarg', 'gist_gray', 'gray', 'bone',
165-
'pink', 'spring', 'summer', 'autumn', 'winter', 'cool',
166-
'Wistia', 'hot', 'afmhot', 'gist_heat', 'copper'])
164+
['gray', 'bone', 'pink', 'spring', 'summer', 'autumn',
165+
'winter', 'cool', 'Wistia', 'hot', 'afmhot', 'gist_heat',
166+
'copper'])
167167

168168
# %%
169+
# .. admonition:: Discouraged
170+
#
171+
# For backward compatibility we additionally support the following colormap
172+
# names, which are identical to other builtin colormaps. Their use is
173+
# discouraged. Use the suggested replacement instead.
174+
#
175+
# ========= =================================
176+
# Colormap Use identical replacement instead
177+
# ========= =================================
178+
# gist_gray gray
179+
# gist_yarg gray_r
180+
# binary gray_r
181+
# ========= =================================
182+
#
183+
#
169184
# Diverging
170185
# ---------
171186
#

0 commit comments

Comments
 (0)