Skip to content

Correct the docs for display() keyword node_pos - #8153

Merged
rossbar merged 4 commits into
networkx:mainfrom
Maninder-sd:change-to-node_pos-display-issue-8143
Jul 23, 2025
Merged

rossbar merged 4 commits into
networkx:mainfrom
Maninder-sd:change-to-node_pos-display-issue-8143

Conversation

@Maninder-sd

@Maninder-sd Maninder-sd commented Jul 16, 2025 •

Copy link
Copy Markdown
Contributor

Fixes issue #8143
[Edit: The issue is about nx.display(G, pos=_) not finding a kwarg named "pos"]

@Maninder-sd

Copy link
Copy Markdown
Contributor Author

I found two more issues with the docstring https://networkx.org/documentation/stable/reference/generated/networkx.drawing.nx_pylab.display.html
The parameters arrowstyle should be edge_arrowstyle and arrowsize should be edge_arrowsize. Should I add this fix in the same pull request?

(Side comment: The pos parameter is used in the draw or draw_networkx functions for a dictionary with nodes as keys and positions as values. In the display function the node_pos is a string or a function.)

@rossbar

rossbar commented Jul 17, 2025

Copy link
Copy Markdown
Contributor

The parameters arrowstyle should be edge_arrowstyle and arrowsize should be edge_arrowsize. Should I add this fix in the same pull request?

Great catch @Maninder-sd - yes please do make those changes here as well!

@rossbar rossbar added type: Documentation Visualization Related to graph visualization or layout labels Jul 17, 2025
@dschult
dschult requested a review from mjschwenne July 17, 2025 16:14
@Maninder-sd

Copy link
Copy Markdown
Contributor Author

@rossbar My changes are ready to be merged! It seems that the code from the main branch is failing the checks. Should I still merge main branch into mine?

@rossbar
rossbar force-pushed the change-to-node_pos-display-issue-8143 branch from 6d3266f to 80e771d Compare July 18, 2025 09:50

@rossbar rossbar left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Thanks @Maninder-sd , LGTM!

I went ahead and rebased on main + manually undid some reversions that were applied to unrelated files. I'd recommend checking your editor settings to make sure you don't have some sort of configuration that modifies files other than the one's you're actively working on!

@dschult dschult changed the title Change to node pos display issue 8143 Correct the docs for display() keyword node_pos Jul 18, 2025

@dschult dschult left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I think these docs changes are straight forward. We probably don't need to wait for a review from @mjschwenne . But I'll wait to merge after the weekend.

@rossbar

rossbar commented Jul 23, 2025

Copy link
Copy Markdown
Contributor

I'll go ahead and put this in so that the dev docs are updated at least, thanks again @Maninder-sd !

@rossbar
rossbar merged commit 4064514 into networkx:main Jul 23, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

type: Documentation Visualization Related to graph visualization or layout

Development

Successfully merging this pull request may close these issues.

3 participants