Skip to content

Instantly share code, notes, and snippets.

@prateekjoshi565
Created October 11, 2019 06:58
Show Gist options
  • Save prateekjoshi565/a56a27328122eb8c0727999ace512213 to your computer and use it in GitHub Desktop.
Save prateekjoshi565/a56a27328122eb8c0727999ace512213 to your computer and use it in GitHub Desktop.
G=nx.from_pandas_edgelist(kg_df[kg_df['edge']=="written by"], "source", "target",
edge_attr=True, create_using=nx.MultiDiGraph())
plt.figure(figsize=(12,12))
pos = nx.spring_layout(G, k = 0.5)
nx.draw(G, with_labels=True, node_color='skyblue', node_size=1500, edge_cmap=plt.cm.Blues, pos = pos)
plt.show()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment