我想绘制我的作品的3d图,但是错误显示参数Z必须是二维的
from mpl_toolkits.mplot3d import Axes3D
figure = plt.figure()
ax = Axes3D(figure)
X = np.arange(0,1,0.01)
Y = np.arange(0,1,0.01)
X,Y = np.meshgrid(X,Y)
M=[]
for i in X:
for j in Y:
NEW_smoothed=holt(Airline_passengers,alpha=i,beta=j)
M.append(sse(new_smoothed[:-2],Airline_passengers.values[2:]))
B=np.array(X)
N=np.array(Y)
Z=np.array(M)
ax.plot_surface(B,N,Z,rstride=1,cstride=1,cmap='rainbow')
plt.show()
我希望有3d图