summaryrefslogtreecommitdiff
path: root/examples/algorithms
diff options
context:
space:
mode:
authorJarrod Millman <jarrod.millman@gmail.com>2017-08-12 18:10:33 -0700
committerGitHub <noreply@github.com>2017-08-12 18:10:33 -0700
commitbbce7787d61d2340236c80f0fa4c67fe95fb62a4 (patch)
tree0ecc6ff179c2830ae4cd8cefd03048becee403d9 /examples/algorithms
parent2c6740efbebf56fc28686bc01c49f541f307d353 (diff)
downloadnetworkx-bbce7787d61d2340236c80f0fa4c67fe95fb62a4.tar.gz
Fix examples (#2606)
Changes due to PR #2604
Diffstat (limited to 'examples/algorithms')
-rw-r--r--examples/algorithms/plot_blockmodel.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/examples/algorithms/plot_blockmodel.py b/examples/algorithms/plot_blockmodel.py
index 648a1513..8457d0ac 100644
--- a/examples/algorithms/plot_blockmodel.py
+++ b/examples/algorithms/plot_blockmodel.py
@@ -70,12 +70,12 @@ if __name__ == '__main__':
nx.draw(H, pos, with_labels=False, node_size=10)
# Draw block model with weighted edges and nodes sized by number of internal nodes
- node_size = [BM.node[x]['nnodes'] * 10 for x in BM.nodes()]
+ node_size = [BM.nodes[x]['nnodes'] * 10 for x in BM.nodes()]
edge_width = [(2 * d['weight']) for (u, v, d) in BM.edges(data=True)]
# Set positions to mean of positions of internal nodes from original graph
posBM = {}
for n in BM:
- xy = numpy.array([pos[u] for u in BM.node[n]['graph']])
+ xy = numpy.array([pos[u] for u in BM.nodes[n]['graph']])
posBM[n] = xy.mean(axis=0)
plt.subplot(212)
nx.draw(BM, posBM, node_size=node_size, width=edge_width, with_labels=False)