Network visualization

Introduction to Network Analysis in Python

Eric Ma

Data Carpentry instructor and author of nxviz package

Irrational vs. Rational visualizations

Two representations of large graphs. In both cases, the structure of the graph is messy, like a hairball, making it difficult to interpret.

Introduction to Network Analysis in Python

Visualizing networks

  • Matrix plots
  • Arc plots
  • Circos plots
Introduction to Network Analysis in Python

Visualizing networks

  • Matrix plots
  • Arc plots
  • Circos plots
Introduction to Network Analysis in Python

Matrix plot

A 3 by 3 matrix with column names A, B, and C, and rownames also A, B, and C. Cells are shaded black where the nodes in the corresponding graph are connected. Next to this is a graph with three nodes labeled A, B, and C. A and B are connected, and A and C are connected, but B and C are not directly connected.

Introduction to Network Analysis in Python

Matrix plot

The same matrix and graph from before, but now the diagonal of the matrix has been shaded gray.

Introduction to Network Analysis in Python

Matrix plot

The same matrix and graph from before, but now cells (A, B) and (B, A) are shaded yellow. The edge in the graph between nodes A and B is also colored yellow.

Introduction to Network Analysis in Python

Matrix plot

The same matrix and graph from before, but now cells (A, C) and (C, A) are shaded yellow. The edge in the graph between nodes A and C is also colored yellow.

Introduction to Network Analysis in Python

Directed matrices

ch1-3.012.png

Introduction to Network Analysis in Python

Visualizing networks

  • Matrix plots
  • Arc plots
  • Circos plots
Introduction to Network Analysis in Python

Arc plot

Two graphs with three nodes each. Both graphs have nodes labeled A, B, and C, and edges between A and B, and between A and C. The first graphs lays out the nodes in a line, and uses curved lines for the edges. The second graph has nodes laid out in a pane and uses straight lines for edges.

Introduction to Network Analysis in Python

Visualizing networks

  • Matrix plots
  • Arc plots
  • Circos plots
Introduction to Network Analysis in Python

Circos plot

ch1-3.018.png

Introduction to Network Analysis in Python

Circos plot

Two graphs with six nodes each. The left-hand plot lays out the nodes in a circle and uses circular arcs for edges. The right-hand plot lays out the nodes randomly and uses straight line edges.

Introduction to Network Analysis in Python

nxviz API

import nxviz as nv
import matplotlib.pyplot as plt

ap = nv.arc(G)
plt.show()
Introduction to Network Analysis in Python

Let's practice!

Introduction to Network Analysis in Python

Preparing Video For Download...