Python Plotly-在选定节点上显示标签

发布于 2025-02-07 05:40:30 字数 406 浏览 2 评论 0原文

我使用图片来绘制网络的绘图。我需要根据其大小和网络选择“顶部”节点。在此示例中,尽管节点4大于节点2,3,但应选择节点1,2,3。因为在该群集节点1中已被选为最大的节点。然后,我想显示节点1,2,3的标签。

如何显示此类节点的标签?

我知道悬停可以显示标签,但仅用于1个节点,而当鼠标移开时消失。 我在所有节点的一个子集中绘制节点标签的技巧 - 但是,按代码选择不允许正确识别“ top”节点1,2,3,如上所述(如果我选择3个最大节点,它给出1,4,2)。 ;

I use plotly to plot a network as in the figure. I need to select "top" nodes based on their size and their networks. In this example, nodes 1,2,3 should be selected, despite the fact that node 4 is bigger than nodes 2,3; because in that cluster node 1 has been selected as the biggest one. Then I want to show label for nodes 1,2,3.

How to show labels of such nodes?

I know that hover can show label, but only for 1 node and disappear when mouse moves away.
I did a trick to plot labels for nodes in a subset of all nodes - however, selecting by code does not allow to correctly identify the "top" nodes 1,2,3 as I want like above (if I select the 3 biggest nodes, it gives 1,4,2).
enter image description here;

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文