In this example, we plot a histogram of the nodes degrees in the Facebook social graphs.
cd fbdata
(bookmark:fbdata) -> chapter2\data\facebook chapter2\data\facebook
import networkx as nx
We open a edge
file with a social graph.
g = nx.read_edgelist('0.edges')
The hist
function plots a histogram of an array of values.
hist(g.degree().values(), bins=20);