with nx_pydot in nx.drawing, we can have more plotting style of network/ tree/ graph.

Here is a simple sample:

import networkx as nx

g=nx.DiGraph()

edgelist = [(0, 1), (1, 12), (2, 12), (3, 17), (4, 11), (5, 4), (6, 10), (7, 12), (8, 14), (9, 14), (10, 11),
            (11, 14), (12, 11), (13, 17), (14, -1), (15, -1), (16, 10), (17, 11), (18, -1)]

g.add_edges_from(edgelist)
p=nx.drawing.nx_pydot.to_pydot(g)
p.write_png('pydot_Tree.png')

the plot result:
Draw graph(network) with nx_pydot in networkx

相关文章:

  • 2021-10-04
  • 2021-12-06
  • 2022-12-23
  • 2021-04-23
  • 2021-09-19
  • 2021-07-11
  • 2021-11-29
  • 2022-12-23
猜你喜欢
  • 2021-05-21
  • 2021-06-27
  • 2022-12-23
  • 2021-12-02
  • 2021-05-26
  • 2022-12-23
  • 2022-01-10
相关资源
相似解决方案