Visualize a Network with Matplotlib

This section uses Matplotlib.

NetworkX is not aesthetically the best library for network visualization. In fact, it does not even do visualization on its own but uses services rendered by Matplotlib, a multipurpose graphics library. Luckily, the team of NetworkX and Matplotlib is fast and easy to understand, and the interaction with Matplotlib is well hidden from the network analyst; you do not need to learn yet another library—but still, you need to import it.

 import​ ​matplotlib.pyplot​ ​as​ ​plt

Note that you typically do not need the whole library, but just the submodule matplotlib.pyplot.

The process of network visualization consists of two phases: layout and rendering. At the layout phase, the ...

Get Complex Network Analysis in Python now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.