matplotlib的cmap

今天又看到了这样的代码:

 

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

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

 

然后发现 get_cmap 经常看到,但是不懂,查了一下,原来后面的就是个名称,然后加 _r 表示反过来。

而名字的列表可以查这里:

 

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

这个页面也可以:

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

 

比如这里:

 

posted @ 2017-12-28 18:46  blcblc  阅读(26022)  评论(0编辑  收藏  举报