In [20]:
import networkx as nx
from matplotlib import pyplot as plt
G=nx.Graph()
G.add_node("spam")
G.add_edge(1,"spam")
G.add_edge(2,"spam")
G.add_edge(1,2)
In [21]:
?nx.draw_networkx
In [22]:
type(G.nodes()[0])
Out[22]:
In [23]:
nx.draw_networkx(G)
In [ ]:
plt.show()
In [ ]: