Skip to content

doc: clarify allowed alpha when using nx.draw_networkx_edges#6254

Merged
rossbar merged 2 commits intonetworkx:mainfrom
SultanOrazbayev:patch-1
Dec 6, 2022
Merged

doc: clarify allowed alpha when using nx.draw_networkx_edges#6254
rossbar merged 2 commits intonetworkx:mainfrom
SultanOrazbayev:patch-1

Conversation

@SultanOrazbayev
Copy link
Copy Markdown
Contributor

This inconsistency between the docs and actual behaviour came up in two StackOverflow questions:

https://stackoverflow.com/a/74106862/20148180
https://stackoverflow.com/q/74622898/10693596

Copy link
Copy Markdown
Member

@dschult dschult left a comment

Choose a reason for hiding this comment

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

This looks good. I checked that alpha does work for drawing edges with both LineCollection and FancyArrowPatch.
I also checked that an alpha list doesn't work for nx.draw_networkx_labels or nx.draw_networkx_edge_labels. That also makes it not work for nx.draw_networkx. It looks like it would be straightforward to add that functionality to the labels functions if anyone is interested. Or maybe there is now a TextCollection that we should be using for the node/edge labels. :} It's hard to keep up with matplotlib. :). If we stick with the current syntax, the labels code may work some day.

For now, this PR is helpful and corrects old information. I approve.

Copy link
Copy Markdown
Contributor

@rossbar rossbar left a comment

Choose a reason for hiding this comment

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

Generally LGTM as well, minus one minor word/semantic nit!

Co-authored-by: Ross Barnowski <rossbar@berkeley.edu>
Copy link
Copy Markdown
Contributor

@rossbar rossbar left a comment

Choose a reason for hiding this comment

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

Thanks for this @SultanOrazbayev !

@rossbar rossbar merged commit 9c79d7d into networkx:main Dec 6, 2022
@jarrodmillman jarrodmillman added this to the networkx-3.0 milestone Dec 13, 2022
MridulS pushed a commit to MridulS/networkx that referenced this pull request Feb 4, 2023
…rkx#6254)

* doc: clarify allowed `alpha` when using nx.draw_networkx_edges

Co-authored-by: Ross Barnowski <rossbar@berkeley.edu>
cvanelteren pushed a commit to cvanelteren/networkx that referenced this pull request Apr 22, 2024
…rkx#6254)

* doc: clarify allowed `alpha` when using nx.draw_networkx_edges

Co-authored-by: Ross Barnowski <rossbar@berkeley.edu>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

4 participants