Closed alfasst closed 1 year ago
I found the error. When reading the saved gml file, the labels are strings. so I had to do,
g = nx.read_gml('netw.gml', label='id')
to get rid of the error
Hi, thanks for raising the issue (and debugging it yourself!). This made me realise that the error message needs improvement. The minus signs to indicate the enumeration are confusing at best, and strings should be represented as such. I will work on that.
Python version: 3.10.6 netgraph version: 4.10.2
I have a network
g
, and I have created apos
dict using a networkx layout function. The output for the list of nodes and pos print are:print(list(g.nodes))
gives ['0', '1', '2', '3', '4', '5', '6', '7', '8', '9']print(pos)
givesWhen I try to plot the network using netgraph, I get the following error:
Graph(g, node_layout=pos, node_edge_width=1, edge_alpha=1, edge_width=1)
I don't understand the problem. My pos dict has all node positions.
Edit: I found the reason when this happens. It happens when the network is taken from a gml file. i have reproduced the issue here: https://colab.research.google.com/drive/1zhe68opt4NlF4BPVc8L1GcdRVdCCbH--