I recently saw this answer: Matplotlib and Networkx - drawing a self loop node
And tried the code for drawing an undirected multigraph:
from networkx.drawing.nx_agraph import to_agraph
G = nx.MultiGraph()
G.add_edges_from([('A','C'),('A','C'),('A','C'), ('C', 'C'), ('B', 'C'), ('A', 'B')])
G.graph['edge'] = {'splines': 'curved'}
G.graph['graph'] = {'scale': '3'}
A = to_agraph(G)
A.layout('dot')
A.draw('images/multigraph_example.png')
However, the result from the code is this:
It only shows one edge from A
to C
. How can I make it show the three edges?