draw_graph_union with subset of nodes

Author: Julia Len ([email protected])


Import packages

In [2]:
import matplotlib.pyplot as plt
import matplotlib as mpl
import networkx as nx
import visJS2jupyter.visualizations as visualizations
import imp
imp.reload(visualizations)
Out[2]:
<module 'visJS2jupyter.visualizations' from '/Users/Julia/anaconda/lib/python2.7/site-packages/visJS2jupyter/visualizations.pyc'>


Create two networks and graph their union

In [8]:
G1 = nx.connected_watts_strogatz_graph(50,5,.1)
G2 = nx.connected_watts_strogatz_graph(20,5,.1)
visualizations.draw_graph_union(G1,G2,edge_width=5,node_name_1="superset",node_name_2="subset",physics_enabled=False)
Out[8]:
Network | Basic usage