Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit f722ea1

Browse files
committed
DOC: Remove deprecated form of plt.register_cmap.
1 parent fe02c3b commit f722ea1

File tree

1 file changed

+3
-7
lines changed

1 file changed

+3
-7
lines changed

examples/color/custom_cmap.py

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,7 @@
155155

156156

157157
###############################################################################
158-
# Now we will use this example to illustrate 3 ways of
158+
# Now we will use this example to illustrate 2 ways of
159159
# handling custom colormaps.
160160
# First, the most direct and explicit:
161161

@@ -170,12 +170,8 @@
170170
blue_red2 = LinearSegmentedColormap('BlueRed2', cdict2)
171171
plt.register_cmap(cmap=blue_red2)
172172

173-
###############################################################################
174-
# Third, for LinearSegmentedColormap only,
175-
# leave everything to register_cmap:
176-
177-
plt.register_cmap(name='BlueRed3', data=cdict3) # optional lut kwarg
178-
plt.register_cmap(name='BlueRedAlpha', data=cdict4)
173+
plt.register_cmap(cmap=LinearSegmentedColormap('BlueRed3', cdict3))
174+
plt.register_cmap(cmap=LinearSegmentedColormap('BlueRedAlpha', cdict4))
179175

180176
###############################################################################
181177
# Make the figure:

0 commit comments

Comments
 (0)