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

Vispy unable to plot networkx.digraph #2480

Open
jaylee321 opened this issue Apr 30, 2023 · 1 comment
Open

Vispy unable to plot networkx.digraph #2480

jaylee321 opened this issue Apr 30, 2023 · 1 comment

Comments

@jaylee321
Copy link

I tried to edit the following example: https://vispy.org/gallery/scene/graph.html#sphx-glr-gallery-scene-graph-py
in order to plot a networkx digraph that I had created. However, it seems to me that vispy can only plot networkx.adjacency_matrix. Is there a way to plot a digraph?

My program raised the following error:

if adjacency_mat.shape[0] != adjacency_mat.shape[1]:
AttributeError: 'DiGraph' object has no attribute 'shape'
[Finished in 2.7s]
@djhoese
Copy link
Member

djhoese commented May 1, 2023

I have almost no experience using networkx or drawing graphs/networks, but that does seem to be the way it appears when reading the code. There are some strong assumptions about how the data is presented to vispy. Is it possible to do some type of conversion?

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

2 participants