我一直在使用 plotly
进行数据框可视化,但是当数据类型为数组时,除了将数组转换为数据框之外,创建交互式绘图的最佳方法是什么?
我以前用于数据框的代码:
import plotly.express as px
fig = px.scatter_3d(df, x='col1', y='col2', z='col3',)
fig.update_traces(marker=dict(size=2,
line=dict(width=0.01)
)
)
fig.update_layout(showlegend=True,
width=900,
height=900,
title = 'My Plot')
fig.show()
答案 0 :(得分:0)
如果你的意思是你有一个 numpy 数组,它的列(或行)给出了你想要绘制的点的坐标,那么你可以将这些列分配给 x
、y
和 {{ 1}} 参数:
z