Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Received invalid argument(s): hold #55

Closed
Xirailuyo opened this issue Oct 24, 2020 · 2 comments
Closed

Received invalid argument(s): hold #55

Xirailuyo opened this issue Oct 24, 2020 · 2 comments

Comments

@Xirailuyo
Copy link

I just installed IDTxl, and seem to be having trouble with the plot_network function. I may be missing a dependency, but I'm having trouble locating the problem. I have attached the error below. All the other functions in the demos seem to be working fine. I am using Ubuntu 20, cuda 11, and anaconda for environment and package management. Importing pylab and matplotlib do not resolve the issue. Thank you.


ValueError Traceback (most recent call last)
in ()
1 # d) Plot inferred network to console and via matplotlib
2 results.print_edge_list(weights='max_te_lag', fdr=False)
----> 3 plot_network(results=results, weights='max_te_lag', fdr=False)
4 # plt.show()

/home/xirailuyo/IDTxl/idtxl/visualise_graph.py in plot_network(results, weights, fdr)
65 fig = plt.figure(figsize=(10, 5))
66 ax1 = plt.subplot(121) # plot graph
---> 67 _plot_graph(graph, ax1, weights)
68 plt.subplot(122) # plot adjacency matrix
69 _plot_adj_matrix(

/home/xirailuyo/IDTxl/idtxl/visualise_graph.py in _plot_graph(graph, axis, weights, display_edge_labels)
153 nx.draw_circular(graph, with_labels=True, node_size=600, alpha=1.0,
154 ax=axis, node_color='Gainsboro', hold=True, font_size=14,
--> 155 font_weight='bold')
156 if display_edge_labels:
157 edge_labels = nx.get_edge_attributes(graph, weights)

/home/xirailuyo/.conda/envs/idtxl/lib/python3.6/site-packages/networkx/drawing/nx_pylab.py in draw_circular(G, **kwargs)
1095 function.
1096 """
-> 1097 draw(G, circular_layout(G), **kwargs)
1098
1099

/home/xirailuyo/.conda/envs/idtxl/lib/python3.6/site-packages/networkx/drawing/nx_pylab.py in draw(G, pos, ax, **kwds)
121 kwds["with_labels"] = "labels" in kwds
122
--> 123 draw_networkx(G, pos=pos, ax=ax, **kwds)
124 ax.set_axis_off()
125 plt.draw_if_interactive()

/home/xirailuyo/.conda/envs/idtxl/lib/python3.6/site-packages/networkx/drawing/nx_pylab.py in draw_networkx(G, pos, arrows, with_labels, **kwds)
324 if any([k not in valid_kwds for k in kwds]):
325 invalid_args = ", ".join([k for k in kwds if k not in valid_kwds])
--> 326 raise ValueError(f"Received invalid argument(s): {invalid_args}")
327
328 node_kwds = {k: v for k, v in kwds.items() if k in valid_node_kwds}

ValueError: Received invalid argument(s): hold

@AlexMa123
Copy link

This bug is because of networkx and matplotlib. After the upgrade of these two libs, they remove the argument "hold." You can try to remove all "hold=True" from the file "visualise_graph.py"

@pwollstadt
Copy link
Owner

Thanks @AlexMa123 for the pointer. We have updated calls to networkx in the current development branch (see 26be465). This will be released shortly. You can try the develop version if you want to use this feature immediately.

pwollstadt added a commit that referenced this issue Feb 25, 2021
Update network plotting to latest networkx version. Matplotlib hold
argument no longer supported. Renamed DiGraph arguments.

Fixes #55.
daehrlich pushed a commit that referenced this issue Aug 2, 2021
Update network plotting to latest networkx version. Matplotlib hold
argument no longer supported. Renamed DiGraph arguments.

Fixes #55.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants