8000 DOC: Update colormap deprecation warning to use Python's copy function. · matplotlib/matplotlib@f3f915c · GitHub
[go: up one dir, main page]

Skip to content

Commit f3f915c

Browse files
committed
DOC: Update colormap deprecation warning to use Python's copy function.
1 parent 77f23da commit f3f915c

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/matplotlib/colors.py

Lines changed: 1 addition & 1 deletion
4B0B
Original file line numberDiff line numberDiff line change
@@ -500,7 +500,7 @@ def _warn_if_global_cmap_modified(cmap):
500500
"colormap. In future versions, you will not be able to "
501501
"modify a registered colormap in-place. To remove this "
502502
"warning, you can make a copy of the colormap first. "
503-
f"cmap = mpl.cm.get_cmap({cmap.name}).copy()"
503+
f'cmap = copy.copy(mpl.cm.get_cmap("{cmap.name}"))'
504504
)
505505

506506

0 commit comments

Comments
 (0)
0