Curved arrows: adding connectionstyle to FancyArrowPatch in "draw_networkx_edges"

347 views
Skip to first unread message

Guido Eco

unread,
Jan 22, 2019, 2:33:54 PM1/22/19
to networkx-discuss
Hello,

I am considering submitting a patch to "draw_networkx_edges" to support passing of the "connectionstyle" parameter to the matplotlib FancyArrowPatch call in draw_networkx_edges.

FancyArrowPatch supports the drawing of curved edge arrows, as per graphviz dot/neato output, through the use of the parameter connectionstyle.See https://matplotlib.org/api/_as_gen/matplotlib.patches.FancyArrowPatch.html#matplotlib.patches.FancyArrowPatch

Extending the call list to FancyArrowPatch in the draw_networkx_edges to pass an arc radius, for example, "connectionstyle='arc3, rad=0.1'" produces a curved arc. The parameter list would default to None.

I realise this is a minor update but I found it made reading bi-directional directed arc easier.

I would welcome your thoughts on whether this is dumb, or a reasonable minor enhancement.

Thanks,

G


Guido Eco

unread,
Jan 23, 2019, 3:02:29 AM1/23/19
to networkx-discuss
Hello again,

I have submitted this as a pull request and set this as WIP as the Travis CI build broke. Having looked at the error logs I am unclear whether this is a regression error or a problem with the patch as the error is:

"File "/home/travis/venv/lib/python3.7/site-packages/networkx/tests/test_convert_pandas.py", line 119, in test_from_edgelist_invalid_attr"

Thanks,

Will

Abe Handler

unread,
Feb 24, 2019, 2:23:38 PM2/24/19
to networkx-discuss
+1 !
Reply all
Reply to author
Forward
0 new messages