networkx icon indicating copy to clipboard operation
networkx copied to clipboard

`connectionstyle` argument of `nx.draw_networkx_edges()` does not work properly for multigraphs and undirected graphs

Open dtekinoglu opened this issue 3 years ago • 1 comments

connectionstyle argument of nx.draw_networkx_edges() does not work properly for MultiGraphs and Undirected graphs. Consider the following example:

G=nx.DiGraph([(1,2),(3,1),(3,2)])
positions = {1:(0,0),2:(1,-2), 3:(2,0)}
nx.draw_networkx_nodes(G, pos=positions, node_size = 500)
nx.draw_networkx_edges(G, pos=positions, arrowstyle="-", connectionstyle="arc3,rad=0.3");

Output is the following:

image

The outputs of the same code snippet when G is created as a multigraph and an undirected graph (G=nx.MultiGraph([(1,2),(3,1),(3,2)]) and G=nx.Graph([(1,2),(3,1),(3,2)])) as follows:

image

dtekinoglu avatar Jul 12 '22 18:07 dtekinoglu

Thanks for reporting @dtekinoglu , this looks like another instance of #5694. It's been discussed at several meetings, but this issue really seems to be biting a lot of people - we should definitely get something in place for the next release!

rossbar avatar Jul 12 '22 19:07 rossbar