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

 

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

 

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-12-02
  • 2022-02-04
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2021-09-18
  • 2022-01-08
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案