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

Fix arrow direction in _visualize_graph_via_networkx #9773

Merged
merged 1 commit into from
Nov 13, 2024

Conversation

darabos
Copy link
Contributor

@darabos darabos commented Nov 11, 2024

Matplotlib arrows don't have a source and a destination. They have a text and a dot. As the example shows, a <- arrow points from the dot to the text and -> points from the text to the dot.
Screenshot 2024-11-11 at 15 47 24
_visualize_graph_via_networkx() sets xy=pos[src] and xytext=pos[dst], so we want arrows from the dot (xy) to the text (xytext). That's the <- arrow.

This can also be confirmed by comparing the visualization to the GraphViz version. The arrows go the other way. Or just looking at the data and the picture, haha! It took me a while to figure out that it's not my graph that's messed up! 😅

@rusty1s rusty1s changed the title Fix arrow direction in _visualize_graph_via_networkx Fix arrow direction in _visualize_graph_via_networkx Nov 13, 2024
Copy link
Member

@rusty1s rusty1s left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice catch :)

@rusty1s rusty1s merged commit 5e5c1a6 into pyg-team:master Nov 13, 2024
18 of 19 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants