Created
April 22, 2022 21:22
-
-
Save Hermann-SW/27742f8b524ec6ea834e740a354e7cbb to your computer and use it in GitHub Desktop.
Planar drawing of C30 fullerene
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
#!/usr/bin/env python | |
import matplotlib.pyplot as plt | |
import networkx as nx | |
C30=[[9,10,1],[0,2,25],[1,18,3],[2,4,26],[3,16,5],[4,6,27],[5,14,7],[6,8,28],[7,12,9],[8,0,29],[0,11,19],[10,12,21],[11,8,13],[12,14,22],[13,6,15],[14,16,23],[15,4,17],[16,18,24],[17,2,19],[18,10,20],[19,21,24],[20,11,22],[21,13,23],[22,15,24],[23,17,20],[1,26,29],[25,3,27],[26,5,28],[27,7,29],[28,9,25]] | |
G = nx.Graph() | |
for i in range(len(C30)): | |
for j in C30[i]: | |
G.add_edge(i, j) | |
plt.figure(figsize=(8,6)) | |
nx.draw_planar(G, with_labels=True) | |
plt.show() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Mathplotlib graph drawing zoom in/out: