I managed to produce the graph correctly, but with some more testing noted inconsistent result for the following two different line of codes:
nx.draw_circular(h,edge_color=[h.edge[i][j]['color'] for (i,j) in h.edges_iter()], width=[h.edge[i][j]['width'] for (i,j) in h.edges_iter()])
nx.draw_circular(h,edge_color=list(nx.get_edge_attributes(h,'color').values()), width=list(nx.get_edge_attributes(h,'width').values()))
The first line results consistent output, while the second produce wrong color/size per the orders of edges.
However, it looks to me the above two lines both rely on the function call to return the attributes per the order of edges. Why the different results?
It looks a bit clumsy to me to access attributes with h[][][]
; is it possible to access it by dot convention, e.g. edge.color for edge in h.edges()
.
Or did I miss anything?