shanger

热图(heatmap)通过色差、亮度来展示数据的差异。

在 Python 的 Matplotlib 库中,调用imshow()函数绘制热图。

 

示例:

import numpy as np
import matplotlib.pyplot as plt 

points = np.arange(-5,5,0.01)

x,y = np.meshgrid(points,points)
z = np.sqrt(x**2 + y**2)

cmaps = [plt.cm.jet, plt.cm.gray, plt.cm.cool, plt.cm.hot]

fig, axes = plt.subplots(2, 2)

for i, ax in enumerate(axes.ravel()):
    ax.imshow(z,cmap=cmaps[i])

plt.show()

分类:

技术点:

相关文章:

  • 2021-08-27
  • 2021-09-01
  • 2021-10-19
  • 2021-05-04
  • 2022-12-23
  • 2022-12-23
  • 2021-05-02
  • 2022-01-10
猜你喜欢
  • 2021-12-15
  • 2021-12-05
  • 2021-05-11
  • 2022-12-23
  • 2021-07-18
  • 2022-12-23
相关资源
相似解决方案