【问题标题】:Getting several cylinders from 3D scatter plot从 3D 散点图中获取多个圆柱体
【发布时间】:2021-03-03 11:57:52
【问题描述】:

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


    【解决方案1】:

    它似乎适用于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()
    

    【讨论】:

      猜你喜欢
      • 2019-09-22
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2023-03-30
      • 2021-06-15
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多