Created
October 11, 2019 06:56
-
-
Save prateekjoshi565/14ab0085b276333be12a4463c42ddb5e to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
G=nx.from_pandas_edgelist(kg_df[kg_df['edge']=="composed by"], "source", "target", | |
edge_attr=True, create_using=nx.MultiDiGraph()) | |
plt.figure(figsize=(12,12)) | |
pos = nx.spring_layout(G, k = 0.5) # k regulates the distance between nodes | |
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