diff options
author | Jeremias Traub <jeremiastraub@gmail.com> | 2020-07-05 20:59:42 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-07-05 14:59:42 -0400 |
commit | 1c302f04703ce7b2e0927b443b54e7642a71e548 (patch) | |
tree | 309adc4d83709293c1f483ab93de5f47df6a5ead /examples | |
parent | 6a17c28054d57756f37f086667defbbf1b1c0c95 (diff) | |
download | networkx-1c302f04703ce7b2e0927b443b54e7642a71e548.tar.gz |
Handle kwds explicitly in draw_networkx (#4033)
* Handle kwds explicitly in draw_networkx; fix kwds in examples
* fix PEP8 issues
Fixes #4020
Diffstat (limited to 'examples')
-rw-r--r-- | examples/algorithms/plot_beam_search.py | 2 | ||||
-rw-r--r-- | examples/drawing/plot_chess_masters.py | 2 | ||||
-rw-r--r-- | examples/drawing/plot_giant_component.py | 3 | ||||
-rw-r--r-- | examples/graph/plot_football.py | 1 | ||||
-rw-r--r-- | examples/graph/plot_roget.py | 2 |
5 files changed, 4 insertions, 6 deletions
diff --git a/examples/algorithms/plot_beam_search.py b/examples/algorithms/plot_beam_search.py index 06d20aed..fd6a21a8 100644 --- a/examples/algorithms/plot_beam_search.py +++ b/examples/algorithms/plot_beam_search.py @@ -99,7 +99,7 @@ pos = nx.spring_layout(G) options = { "node_color": "blue", "node_size": 20, - "line_color": "grey", + "edge_color": "grey", "linewidths": 0, "width": 0.1, } diff --git a/examples/drawing/plot_chess_masters.py b/examples/drawing/plot_chess_masters.py index 4bb877c1..35f47d74 100644 --- a/examples/drawing/plot_chess_masters.py +++ b/examples/drawing/plot_chess_masters.py @@ -121,7 +121,7 @@ nx.draw_networkx_edges(H, pos, alpha=0.3, width=edgewidth, edge_color="m") nodesize = [wins[v] * 50 for v in H] nx.draw_networkx_nodes(H, pos, node_size=nodesize, node_color="w", alpha=0.4) nx.draw_networkx_edges(H, pos, alpha=0.4, node_size=0, width=1, edge_color="k") -nx.draw_networkx_labels(H, pos, fontsize=14) +nx.draw_networkx_labels(H, pos, font_size=14) font = {"fontname": "Helvetica", "color": "k", "fontweight": "bold", "fontsize": 14} plt.title("World Chess Championship Games: 1886 - 1985", font) diff --git a/examples/drawing/plot_giant_component.py b/examples/drawing/plot_giant_component.py index 91077b7d..ce7101e4 100644 --- a/examples/drawing/plot_giant_component.py +++ b/examples/drawing/plot_giant_component.py @@ -41,14 +41,13 @@ for p in pvals: # identify largest connected component Gcc = sorted(nx.connected_components(G), key=len, reverse=True) G0 = G.subgraph(Gcc[0]) - nx.draw_networkx_edges(G0, pos, with_labels=False, edge_color="r", width=6.0) + nx.draw_networkx_edges(G0, pos, edge_color="r", width=6.0) # show other connected components for Gi in Gcc[1:]: if len(Gi) > 1: nx.draw_networkx_edges( G.subgraph(Gi), pos, - with_labels=False, edge_color="r", alpha=0.3, width=5.0, diff --git a/examples/graph/plot_football.py b/examples/graph/plot_football.py index a6e96901..1d215b12 100644 --- a/examples/graph/plot_football.py +++ b/examples/graph/plot_football.py @@ -40,7 +40,6 @@ for n, d in G.degree(): options = { "node_color": "black", "node_size": 50, - "line_color": "grey", "linewidths": 0, "width": 0.1, } diff --git a/examples/graph/plot_roget.py b/examples/graph/plot_roget.py index 4f8df1a4..35c040a6 100644 --- a/examples/graph/plot_roget.py +++ b/examples/graph/plot_roget.py @@ -72,7 +72,7 @@ print(nx.number_connected_components(UG), "connected components") options = { "node_color": "black", "node_size": 1, - "line_color": "grey", + "edge_color": 'gray', "linewidths": 0, "width": 0.1, } |