Chapter 4, example 3

In this example, we plot a histogram of the nodes degrees in the Facebook social graphs.


In [1]:
cd fbdata


(bookmark:fbdata) -> chapter2\data\facebook
chapter2\data\facebook

In [2]:
import networkx as nx

We open a edge file with a social graph.


In [3]:
g = nx.read_edgelist('0.edges')

The hist function plots a histogram of an array of values.


In [4]:
hist(g.degree().values(), bins=20);