network graph bokeh

Solutions on MaxInterview for network graph bokeh by the best coders in the world

showing results for - "network graph bokeh"
Deedee
28 Feb 2018
1import networkx as nx
2
3from bokeh.io import output_file, show
4from bokeh.plotting import figure, from_networkx
5
6G = nx.karate_club_graph()
7
8plot = figure(title="Networkx Integration Demonstration", x_range=(-1.1,1.1), y_range=(-1.1,1.1),
9              tools="", toolbar_location=None)
10
11graph = from_networkx(G, nx.spring_layout, scale=2, center=(0,0))
12plot.renderers.append(graph)
13
14output_file("networkx_graph.html")
15show(plot)
16