从 3D 散点图中获取多个圆柱体

Getting several cylinders from 3D scatter plot

我得到了一个看起来像“管”的 3D 散点图,它实际上应该显示什么。目前每个“管”由 40 个标记组成。我正在尝试的是,这 40 个标记一起构建了一个圆柱体,它看起来像一个管子,带有来自 XYZ 的位置参数以及来自 [=14= 的着色].

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

有人知道这怎么可能吗?

它似乎适用于 mayavi.mlap

from mayavi.mlab import *
from mayavi import mlab
from PyQt5 import QtWidgets

X = df['Tube']
Y = df['Window']
C = df['Value']
Z = df['Depth']

plot3d(X, Y, Z, C, tube_radius=0.25, colormap='Reds')
mlab.show()