python matplotlib 绘制热成像图

    技术2025-01-15  21

    python matplotlib 绘制热成像图

    """ 绘制热成像图 """ import numpy as np import matplotlib.pyplot as mp # 准备数据 num = 1000 x, y = np.meshgrid(np.linspace(-3, 3, 1000), np.linspace(-3, 3, 1000)) z = (1 - x / 2 + x ** 5 + y ** 3) * np.exp(-x ** 2 - y ** 2) # 绘制图片 mp.figure("imshow", figsize=(8, 6), facecolor="lightgray") mp.title("imshow", fontsize=18) mp.imshow(z, cmap="jet", origin="lower") mp.colorbar() mp.show()

    Processed: 0.009, SQL: 9