码迷,mamicode.com
首页 > 其他好文 > 详细

matplotlib的cmap

时间:2017-12-28 21:37:50      阅读:171      评论:0      收藏:0      [点我收藏+]

标签:bug   col   use   pos   htm   otl   bsp   class   reference   

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

 

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

 

比如这里:

技术分享图片

 

matplotlib的cmap

标签:bug   col   use   pos   htm   otl   bsp   class   reference   

原文地址:https://www.cnblogs.com/charlesblc/p/8137265.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!