title: "node '0' has no position - problems with allocating node positions to 'node types' in networkX/Python
body: <p>I'm trying to plot a graph using networkX. </p>
  
  <p>I have defined the precise positions as:</p>
  
  <pre><code>pos={0:(40,100), 1:(50,100), 2:(45,80), 3:(55,80), 4:(50,60), 5:(50,40), 6:(50,20)}
  </code></pre>
  
  <p>I am then separating the nodes into two 'types', so let's say that nodes 0, 2, 4, 6 are <strong>'type a'</strong> and 1, 3, 5 are <strong>'type b'</strong>. I am appending them to the two different node lists using the append function. So now I have the two different node lists: <strong>type_a</strong> and <strong>type_b</strong> and can plot them - for example using:</p>
  
  <pre><code>nx.draw_networkx_nodes(G, pos, nodelist=type_a, node_size=2000,node_shape="s", node_color='g', labels=exploit_node_labels, with_labels=True, alpha=1)
  </code></pre>
  
  <p>My problem is in being able to allocate the node positions to the node at the time that I allocate the node. How do I allocate 'pos' at the point of appending the nodes to the two different lists?</p>
  
  <p>This approach gives me an error as follows:</p>
  
  <pre><code>nx.draw_networkx_nodes(G, pos, nodelist=type_a, node_size=2000,node_shape="s", node_color='g', labels=exploit_node_labels, with_labels=True, alpha=1)
            File "C:\Program Files\Python36\lib\site-packages\networkx\drawing\nx_pylab.py", line 386, in draw_networkx_nodes
              raise nx.NetworkXError('Node %s has no position.'%e)
  
  networkx.exception.NetworkXError: Node '0' has no position.
  </code></pre>