Tôi có 3 ndarrays 1-D: x, y, zpcolormesh có giá trị bị thiếu?
và đoạn mã sau:
import numpy as np
import matplotlib.pyplot as plt
import scipy.interpolate as spinterp
## define data
npoints = 50
xreg = np.linspace(x.min(),x.max(),npoints)
yreg = np.linspace(y.min(),y.max(),npoints)
X,Y = np.meshgrid(xreg,yreg)
Z = spinterp.griddata(np.vstack((x,y)).T,z,(X,Y),
method='linear').reshape(X.shape)
## plot
plt.close()
ax = plt.axes()
col = ax.pcolormesh(X,Y,Z.T)
plt.draw()
cốt truyện của tôi đi ra trống, và tôi nghi ngờ đó là vì phương pháp này = 'thẳng' suy đi ra với nans. Tôi đã cố gắng chuyển đổi thành một mảng bị che dấu, nhưng không có lịch phát sóng - cốt truyện vẫn trống. Bạn có thể cho tôi biết những gì tôi đang làm sai? Cảm ơn.