简体   繁体   English

如何在 plotly 3d 网格中突出显示 xyz 点?

[英]How to highlight xyz points in plotly 3d mesh?

I have created a mesh 3d figure in plotly我在 plotly 中创建了一个网格 3d 图

import plotly.graph_objects as go

fig = go.Figure(data=[
    go.Mesh3d(
        x=[0, 1, 0, 0],
        y=[0, 0, 1, 0],
        z=[0, 0, 0, 1],
        i=[0, 0, 0, 1],
        j=[1, 2, 3, 2],
        k=[2, 3, 1, 3],
    )
])

fig.show()

在此处输入图像描述

How can I highlight the xyz-points?如何突出显示 xyz 点? So that it looks like the following:所以它看起来像下面这样:

在此处输入图像描述

I referred to @rpanai's answer from How to add data (or single point) to an existing 3d scatter plotly exprees plot in python .我从How to add data (or single point) to an existing 3d scatter plotly exprees plot in python 中参考了@rpanai 的回答


You can use the following code before fig.show() to get xyz points:您可以在fig.show()之前使用以下代码来获取 xyz 点:

fig.add_trace(
    go.Scatter3d(x=[0, 1, 0, 0],
                 y=[0, 0, 1, 0],
                 z=[0, 0, 0, 1],
                 mode='markers')
)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM