我试图绘制通过一组(X,Y,Z)3d点的3d曲面,并且出现了ValueError(“ Argument Z必须是二维的。”)matplotlib
points = Tail_geo(D,L) # is a list from a function
points = points + Nose_geo(D,L)# is a list from both function s
X = [x[0] for x in points]# seperate X from the list
Y = [x[1] for x in points]
Z = [x[2] for x in points]
X = np.asarray(X)
Y = np.asarray(Y)
Z = np.asarray(Z)
fig = plt.figure()
ax = fig.gca(projection='3d')
surf = ax.plot_surface(X, Y, Z, linewidth=0, antialiased=False)
plt . show ( )
Run Code Online (Sandbox Code Playgroud)