python,graph,matplotlib,networkx,graphml

You are right, GraphML want's simpler attributes (no numpy arrays or lists). You can set the x and y positions of the nodes as attributes like this G = nx.path_graph(4) pos = nx.spring_layout(G) for node,(x,y) in pos.items(): G.node[node]['x'] = float(x) G.node[node]['y'] = float(y) nx.write_graphml(G, "g.graphml") ...

python,graph,matplotlib,networkx,graphml

Assign the x and y values to the a dictionary with node keys In [1]: pos = {} In [2]: for n,data in G.node.items(): ...: pos[n] = (data['x'],data['y']) ...: ...