plt.cm.get_cmap 中可以使用哪些名称?

Matplotlib 提供了许多颜色图,可以使用:func:'~matplotlib.cm.register_cmap'添加其他颜色图。此函数记录内置颜色图,如果调用,还将返回所有已注册颜色图的列表。

示例

from matplotlib import pyplot as plt

cmaps = plt.colormaps()

print("可能的颜色映射是: ")

for item in cmaps:
   print(item)
输出结果
Accent
Accent_r
Blues
...
...
...
viridis_r
winter
winter_r