title: How can I display label for graph nodes in python networkx
body: <p>I have following code to visualize networkx graph:</p>
  
  <pre><code>node_positions = networkx.spring_layout(graph)
  networkx.draw_networkx_nodes(graph, node_positions)
  networkx.draw_networkx_edges(graph, node_positions, style='dashed')
  </code></pre>
  
  <p>I want to display node label on each node. <code>graph.nodes()</code> will give me list of all the nodes but how can I use them to label nodes on the graph?</p>
  
  <p>I tried this, but it is not working:</p>
  
  <pre><code>networkx.draw_networkx_labels(graph,node_positions,graph.nodes(data="false"),font_size=16)
  </code></pre>
  
  <p>EDIT:</p>
  
  <p>I tried following and its working for now:</p>
  
  <pre><code>for node,_ in graph.nodes(data="False"):
          labels[node] = node;
  networkx.draw_networkx_labels(graph,node_positions,labels,font_size=16)
  </code></pre>
  
  <p>If there is still some elegant way to do it please let me know. I feel creating new dict is overkill, redundant and should not be required.</p>