Doing a network visualization spot check
Let’s visualize these networks, take a brief look, and then complete this chapter.
Here are two visualization functions that I frequently use. In my opinion, sknetwork is superior to NetworkX for network visualization. The visualizations look better, and they render faster. The downside is that there is less customizability, so if you want flexibility, you will need to use NetworkX’s native visualizations. Since finding sknetwork
, I have not looked back to NetworkX for visualization.
The first function converts a NetworkX graph into an adjacency matrix, which sknetwork uses to calculate PageRank
(an importance score) and then to render the network as an SVG image. The second function uses the first function, but the goal is to visualize an ego_graph
, which will be described later. In an ego graph, you explore the relationships that exist around a single node. The first function is more general-purpose.
Enough talk. This...