我试图从我们测量的矢量场中绘制流线。正如您在 3D 散点图和 3D 锥图中看到的那样,它是一个偶极场。我很困惑,因为 Plotly 流线图不会显示任何内容。
我的尝试
- 在此处下载数据:https ://datashare.mpcdf.mpg.de/s/9ZEYhrOo9vq88s0
- 应用以下代码:
df = pd.read_csv('dipole_field_edited.csv')
######## 3D Scatter Plot ########
fig = px.scatter_3d(df,
x='x',
y='y',
z='z',
color='Mod',
size='Mod',
size_max=20)
fig.show()
######## 3D Cone Plot ########
fig = go.Figure(data = go.Cone(
x=df['x'],
y=df['y'],
z=df['z'],
u=df['V_x'],
v=df['V_y'],
w=df['V_z'],
sizeref=10))
fig.update_layout(scene=dict(aspectratio=dict(x=1, y=1, z=0.8),
camera_eye=dict(x=1.2, y=1.2, z=0.6)))
fig.show()
######## 3D Streamtube Plot ########
fig = go.Figure(data=go.Streamtube(
x = df['x'],
y = df['y'],
z = df['z'],
u = df['V_x'],
v = df['V_y'],
w = df['V_z'],
sizeref = 5.0,
colorscale = 'Portland',
maxdisplayed = 3000
))
fig.update_layout(
scene = dict(
aspectratio = dict(
x = 1,
y = 1,
z = 1
)
),
margin = dict(
t = 20,
b = 20,
l = 20,
r = 20
)
)
fig.show()
似乎 Plotly Streamtube 甚至没有看到向量及其分布。
我也尝试指定起始位置,没有任何帮助
starts = dict(
x = [490] * len(Y),
y = Y,
z = [240] * len(Y)
),
和
Y=[280.0, 280.0, 280.0, 290.0, 300.0, 310.0, 320.0, 330.0, 350.0, 360.0, 380.0, 390.0, 410.0, 420.0, 430.0, 450.0, 460.0, 480.0, 490.0, 520.0, 550.0, 560.0, 580.0, 620.0, 640.0, 650.0, 690.0, 700.0, 710.0, 720.0, 720.0]
但没有任何成功。有人可以帮忙吗?