title: Node size dependent on the node degree on NetworkX
body: <p>I imported my Facebook data onto my computer in the form of a .json file. The data is in the format:</p>
  
  <pre><code>{"nodes":[{"name":"Alan"},{"name":"Bob"}],"links":[{"source":0,"target:1"}]}
  </code></pre>
  
  <p>Then, I use this function:</p>
  
  <pre><code>def parse_graph(filename):
  """
  Returns networkx graph object of facebook
  social network in json format
  """
  G = nx.Graph()
  json_data=open(filename)
  data = json.load(json_data)
  # The nodes represent the names of the respective people
  # See networkx documentation for information on add_* functions
  G.add_nodes_from([n['name'] for n in data['nodes']])
  G.add_edges_from([(data['nodes'][e['source']]['name'],data['nodes'][e['target']]['name']) for e in data['links']])
  json_data.close()
  return G
  </code></pre>
  
  <p>to enable this .json file to be used a graph on NetworkX. If I find the degree of the nodes, the only method I know how to use is:</p>
  
  <pre><code>degree = nx.degree(p)
  </code></pre>
  
  <p>Where <strong>p</strong> is the graph of all my friends. Now, I want to plot the graph such that the size of the node is the same as the degree of that node. How do I do this?</p>
  
  <p>Using:</p>
  
  <pre><code>nx.draw(G,node_size=degree)
  </code></pre>
  
  <p>didn't work and I can't think of another method.</p>