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


Matplotlib 提供了許多配色圖,還可以使用 :func:'~matplotlib.cm.register_cmap' 新增其他配色圖。此函式記錄了內建配色圖,如果呼叫該函式,它還將返回所有已註冊配色圖的列表。

示例

from matplotlib import pyplot as plt

cmaps = plt.colormaps()

print("Possible color maps are: ")

for item in cmaps:
   print(item)

輸出

Accent
Accent_r
Blues
...
...
...
viridis_r
winter
winter_r

更新於: 05-06-2021

195 次瀏覽

開啟你的 職業

透過完成課程獲得認證

開始
廣告
© . All rights reserved.