1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49
| G.clear()
plt.subplots(2,3,figsize=(15,6))
G=nx.grid_2d_graph(2,3) plt.subplot(2,3,1) nx.draw(G,with_labels=True) plt.title('grid_2d_graph') plt.axis('on') plt.xticks([]) plt.yticks([])
grid_graph = nx.grid_graph(dim=[1, 3, 4]) plt.subplot(2,3,2) nx.draw(grid_graph,with_labels=True) plt.title('grid_graph') plt.axis('on') plt.xticks([]) plt.yticks([])
G=nx.hexagonal_lattice_graph(2,3) plt.subplot(2,3,3) nx.draw(G,with_labels=True) plt.title('hexagonal_lattice_graph') plt.axis('on') plt.xticks([]) plt.yticks([])
G=nx.hypercube_graph(3) plt.subplot(2,3,4) nx.draw(G,with_labels=True) plt.title('hypercube_graph') plt.axis('on') plt.xticks([]) plt.yticks([])
G=nx.triangular_lattice_graph(1,3) plt.subplot(2,3,5) nx.draw(G,with_labels=True) plt.title('hypercube_graph') plt.axis('on') plt.xticks([]) plt.yticks([])
plt.show()
|