Skip to content

Instantly share code, notes, and snippets.

@techwithshadab
Created April 5, 2020 23:18
Show Gist options
  • Save techwithshadab/c42499dd4a8f17b033eeb867adadc19e to your computer and use it in GitHub Desktop.
Save techwithshadab/c42499dd4a8f17b033eeb867adadc19e to your computer and use it in GitHub Desktop.
def plot_save(repo_name):
name = repo_name.split("/")[-1]
plt.figure(figsize = (30,30))
graph = nx.Graph()
graph = mount_graph(repo_name, graph)
pos = nx.spring_layout(graph, scale=3)
n = graph.number_of_nodes()
nx.draw(graph, pos, node_size=40000, node_color=range(n), with_labels=True, font_size=20, font_weight='bold', cmap=plt.cm.Blues)
nx.write_graphml(graph, name+"_countries.graphml")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment