0
我有一個滑塊條,它給出了要繪製的CSV文件的行。滑桿功能正常,並將返回正確的值。但是,我無法將值顯示在圖上。有兩件事情繪製了散點圖(4點)和插值曲面。散點圖按預期顯示。這是更新代碼:更新Matplotlib中的2D表面
def update (val):
ax.clear()
val=int(val)
new=a[val]
canvas1.blit(axsigma.bbox)
ax.scatter(x, y, marker='o', s=256, lw=.1)
xi, yi = np.mgrid[x.min():x.max():500j, y.min():y.max():500j]
newi = griddata(x,y,new,xi,yi, interp='nn')
CS = plt.contourf(xi,yi,newi,500,cmap='jet', vmax=5, vmin=0) ##This line should plot the new temperatures
ax.relim()
ax.autoscale_view(True,True,True)
任何意見將不勝感激。提前致謝!