summaryrefslogtreecommitdiff
path: root/examples
diff options
context:
space:
mode:
authorJarrod Millman <jarrod.millman@gmail.com>2019-10-10 13:58:11 -0700
committerJarrod Millman <jarrod.millman@gmail.com>2019-10-12 09:26:31 -0700
commit32bb9a11668de99cda63133724ea2590bcbb0cbf (patch)
tree2dba3ac69b441b8163dd5c7a83a224139a1f9a6c /examples
parentaa5ff1d4d4f839e53be39df6ef8de19950b80c34 (diff)
downloadnetworkx-32bb9a11668de99cda63133724ea2590bcbb0cbf.tar.gz
Fix examples
Diffstat (limited to 'examples')
-rw-r--r--examples/drawing/plot_atlas.py2
-rw-r--r--examples/drawing/plot_giant_component.py2
2 files changed, 2 insertions, 2 deletions
diff --git a/examples/drawing/plot_atlas.py b/examples/drawing/plot_atlas.py
index 2af022a5..3c49ba81 100644
--- a/examples/drawing/plot_atlas.py
+++ b/examples/drawing/plot_atlas.py
@@ -83,7 +83,7 @@ if __name__ == '__main__':
# layout graphs with positions using graphviz neato
pos = graphviz_layout(G, prog="neato")
# color nodes the same in each connected subgraph
- C = (U.subgraph(c) for c in nx.connected_components(U))
+ C = (G.subgraph(c) for c in nx.connected_components(G))
for g in C:
c = [random.random()] * nx.number_of_nodes(g) # random color...
nx.draw(g,
diff --git a/examples/drawing/plot_giant_component.py b/examples/drawing/plot_giant_component.py
index 896de1d4..6e6954a4 100644
--- a/examples/drawing/plot_giant_component.py
+++ b/examples/drawing/plot_giant_component.py
@@ -67,7 +67,7 @@ for p in pvals:
# show other connected components
for Gi in Gcc[1:]:
if len(Gi) > 1:
- nx.draw_networkx_edges(Gi, pos,
+ nx.draw_networkx_edges(G.subgraph(Gi), pos,
with_labels=False,
edge_color='r',
alpha=0.3,