title: How to draw loops-edges in networkx indirected Graph
body: <p>I have the following graph:</p>
  
  <pre><code>graph = {("A","A"): 3, ("A","B"): 4, ("A","C"): 1}
  </code></pre>
  
  <p>And I am trying to draw a graph that shows a loop in node ("A") labeled with the number 3. The loop should look like the one for node (1) <a href="https://upload.wikimedia.org/wikipedia/commons/2/28/6n-graph2.svg" rel="nofollow noreferrer">here</a>.</p>
  
  <p>It has to be an indirected graph.</p>
  
  <p>So far I am using this:</p>
  
  <pre><code>import networkx as nx
  import matplotlib.pyplot as plt
  
  G=nx.Graph()
  
  for edge in graph:
      G.add_edge(edge[0], edge[1])
  graph_pos=nx.shell_layout(G)
  nx.draw_networkx_nodes(G,graph_pos)
  nx.draw_networkx_edges(G,graph_pos)
  nx.draw_networkx_labels(G, graph_pos)
  nx.draw_networkx_edge_labels(G, graph_pos, edge_labels = graph)
  
  plt.show()
  </code></pre>
  
  <p>The output is:</p>
  
  <p><a href="https://i.stack.imgur.com/63Gc4.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/63Gc4.png" alt="enter image description here"></a></p>
  
  <p>As you can see, there is no loop around node "A" even thought there is an edge ("A", "A"). Any idea on how I can make it happen? </p>
  
  <p><strong>EDIT - why not a duplicate?</strong></p>
  
  <p>The question <a href="https://stackoverflow.com/questions/49340520/matplotlib-and-networkx-drawing-a-self-loop-node">Matplotlib and Networkx - drawing a self loop node</a> is for directed graphs. When you create a graph using <code>G=nx.MultiDiGraph</code> you can set attributes for the edges using <code>G.graph['edge']</code>.</p>
  
  <p>Using <code>nx.Graph()</code> (indirected graph), the results for <code>G.graph['edge']</code> is an empty dictionary.</p>
  
  <p>The difference between that question and this question is, in essence, that I use <code>nx.Graph</code> and that question uses <code>nx.MultiDiGraph</code>. </p>