Skip to content

Commit

Permalink
Merge pull request #4551 from neutrinoceros/cmap_avoid_double_copies
Browse files Browse the repository at this point in the history
  • Loading branch information
neutrinoceros authored Jun 28, 2023
2 parents 56c50e3 + f90c800 commit 0db75b9
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion yt/visualization/color_maps.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,8 @@ def register_yt_colormaps_from_cmyt():
"""

for hist_name, alias in _HISTORICAL_ALIASES.items():
cmap = mpl.colormaps[alias].copy()
# note that mpl.colormaps.__getitem__ returns *copies*
cmap = mpl.colormaps[alias]
cmap.name = hist_name
mpl.colormaps.register(cmap)
mpl.colormaps.register(cmap.reversed())
Expand Down

0 comments on commit 0db75b9

Please sign in to comment.