griddata 插值

x,y,d = 一维数组(散点数据)  # 适用于散点数据插值为格点数据
x1, y1 = np.meshgrid(x, y)
for i in ['linear', 'nearest', 'cubic']:
    DATA = griddata((x, y), d, (x1, y1), method=i)
    plt.contourf(x1, y1, DATA, cmap=cmap)
    plt.title(i)
    plt.show()

 

posted on 2022-10-26 17:37  闹不机米  阅读(50)  评论(0编辑  收藏  举报

导航