简体   繁体   English

在networkx中使用draw_circular时如何修复节点的位置?

[英]How to fix position of nodes when using draw_circular in networkx?

I want to draw two graphs are almost same, the only difference is that the second one will have some edges grayed out.我想画的两张图几乎一样,唯一的区别是第二张会有些边变灰。 And I want nodes in the second graph stay exactly where they are in the first graph.我希望第二个图中的节点完全保持在第一个图中的位置。

You need to define the optional pos argument.您需要定义可选的pos参数。

In your case using circular layout pos = nx.circular_layout(G) .在您的情况下使用圆形布局pos = nx.circular_layout(G) Then you call the plotting commands like nx.draw(G, pos, other_arguments...) .然后你调用像nx.draw(G, pos, other_arguments...)这样的绘图命令。

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

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