Основная часть программы
n_nd = 1 for i_l in range(n_lines): for i_n in range(n_nods[i_l]): G.add_node(1,label=str(n_nd)) n_nd += 1 G.add_edge(i_l,i_n) pos = {n_nd:(i_l,i_n) } nx.draw(G,with_label=True)
“ Traceback (most recent call last):
File ”c:\Users\frost\Net\Net.py“, line 22, in <module>
nx.draw(G,with_label=True)
File ”C:\Users\frost\AppData\Local\Programs\Python\Python312\Lib\site-packages
\networkx\drawing\nx_pylab.py“, line 126, in draw
draw_networkx(G, pos=pos, ax=ax, **kwds)
File ”C:\Users\frost\AppData\Local\Programs\Python\Python312\Lib\site-packages
\networkx\drawing\nx_pylab.py“, line 305, in draw_networkx
raise ValueError(f”Received invalid argument(s): {invalid_args}“)
ValueError: Received invalid argument(s): with_label ”
Линия 22 это draw
При использовании nx.draw(G) все рисуется.