From bbce7787d61d2340236c80f0fa4c67fe95fb62a4 Mon Sep 17 00:00:00 2001 From: Jarrod Millman Date: Sat, 12 Aug 2017 18:10:33 -0700 Subject: Fix examples (#2606) Changes due to PR #2604 --- examples/algorithms/plot_blockmodel.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'examples/algorithms/plot_blockmodel.py') 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) -- cgit v1.2.1