【发布时间】:2021-03-03 11:57:52
【问题描述】:
我得到了一个看起来像“管”的 3D 散点图,它实际上应该显示什么。目前,每个“管”由 40 个标记组成。我正在尝试的是,这 40 个标记一起构建了一个圆柱体,它看起来像一个管子,带有来自 X、Y 和 Z 的位置参数以及来自 C 的颜色。
X = df['Tube']
Y = df['Window']
C = df['Value']
Z = df['Depth']
fig = plt.figure()
ax = fig.add_subplot(111, projection='3d')
ax.scatter3D(X,Y,Z, marker='o',s=50, c=C, cmap = 'Reds',edgecolors= "black")
df
Tube Window Value Depth
0 1 1 0.000383 -0.1
1 1 2 0.023253 -0.1
2 1 3 0.022623 -0.1
3 1 4 0.003599 -0.1
4 1 5 0.001281 -0.1
... ... ... ... ...
2155 54 36 0.020977 -1.2
2156 54 37 0.000000 -1.2
2157 54 38 0.007104 -1.2
2158 54 39 0.015233 -1.2
2159 54 40 0.000000 -1.2
有人知道这怎么可能吗?
【问题讨论】:
标签: python matplotlib plot plotly plotly-python