matplotlib的cmap

今天又看到了這樣的代碼:html

 

plt.imshow(X_train[0], cmap=plt.get_cmap('PuBuGn_r'))spa

#plt.imshow(X_train[0], cmap=plt.get_cmap('PuBuGn'))orm

 

而後發現 get_cmap 常常看到,可是不懂,查了一下,原來後面的就是個名稱,而後加 _r 表示反過來。htm

而名字的列表能夠查這裏:blog

 

https://matplotlib.org/users/colormaps.htmlget

這個頁面也能夠:class

https://matplotlib.org/examples/color/colormaps_reference.htmlmap

 

好比這裏:im

相關文章
相關標籤/搜索