关于matplotlib及相关cmap参数的取值

在matplotlib中对于图片的显示有如下方法(这不是重点), 其中有cmap=‘binary’的参数。

plt.imshow(imgs[i].reshape(28, 28), cmap='binary')
#或如下:也可以达到相同的效果
plt.imshow(imgs[i].reshape(28, 28), cmap=plt.get_cmap('binary'))

这 是对显示颜色参数的定义,它可以有很多渐变色可以选择:
具体取值详细参见:
https://matplotlib.org/users/colormaps.html
https://matplotlib.org/examples/color/colormaps_reference.html

关于matplotlib及相关cmap参数的取值

相关文章:

  • 2021-08-03
  • 2021-12-06
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-09-16
  • 2021-06-04
  • 2022-12-23
  • 2021-04-20
相关资源
相似解决方案