O'Reilly logo

Complex Network Analysis in Python by Dmitry Zinoviev

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Draw the Network

The size of the network generated in the previous section makes its visualization almost useless. However, the plotting fragment is still included in the case study. Nodes are painted by their kind: Entities are lightly colored, and Officers are dark.

 cdict = {​"Entities"​: ​"pink"​, ​"Officers"​: ​"blue"​,
 "Intermediaries"​ : ​"green"​}
 c = [cdict[panama0.nodes[n][​"kind"​]] ​for​ n ​in​ panama0]
 dzcnapy.small_attrs[​"node_color"​] = c
 pos = graphviz_layout(panama0)
 nx.draw_networkx(panama0, pos=pos, with_labels=False, **dzcnapy.small_attrs)
 dzcnapy.set_extent(pos, plt)
 dzcnapy.plot(​"panama0"​)

The following figure shows the sketch of the network (naturally, without the labels). You can see with a naked ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required