import networkx
import matplotlib

G = networkx.read_gml("two_triads_connect_green.gml")

pos={'A':(40, 40),
          'B':(10, 10),
          'C':(70, 10),
          'D':(140, 40),
          'E':(110, 10),
          'F':(170, 10)}


for edge in G.edges():
   networkx.draw_networkx_edges(G,
          pos=pos,
          edgelist={edge},
          edge_color='g',
          width=8.0*G.adj[edge[0]][edge[1]]['weight'])
   networkx.draw_networkx_edge_labels(G,
          pos=pos, 
          alpha=0,
          edge_labels={(edge[0], edge[1]):G.adj[edge[0]][edge[1]]['weight']})

networkx.draw_networkx_nodes(G, pos=pos, node_size=1000, node_color='w')
networkx.draw_networkx_labels(G, pos=pos)

matplotlib.pyplot.xlim(0, 180)
matplotlib.pyplot.ylim(0, 80)
matplotlib.pyplot.axis('off')
matplotlib.pyplot.savefig("clusters.png")
matplotlib.pyplot.show()
