小编Ibr*_*wra的帖子

使用python绘制3D曲面:raise ValueError(“参数Z必须为二维。”)matplotlib

我试图绘制通过一组(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)

python matplotlib

2
推荐指数
1
解决办法
7147
查看次数

标签 统计

matplotlib ×1

python ×1