首页 > 解决方案 > 带有 3 维列表的 3d 散点图

问题描述

print(grid)

xmin, xmax, ymin, ymax, zmin, zmax = 0, x, 0, y, 0, z  
plt.rcParams["figure.figsize"] = (6, 6)  
fig = plt.figure()  
ax = fig.add_subplot(111, projection='3d')

plt.plot(grid)
plt.grid(True)
plt.show()

ax.scatter(x,y,z)

我想绘制 3D 散点图。但 scatter() 总是必须使用 x,y,z 数据框。我只有一个 3 维列表数据。我想要带有 3 维列表的 3d 散点图,如下图所示。

标签: pythonmatplotlib

解决方案


推荐阅读