简体   繁体   中英

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.

In your case using circular layout pos = nx.circular_layout(G) . Then you call the plotting commands like nx.draw(G, pos, other_arguments...) .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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