diff options
-rw-r--r-- | networkx/drawing/layout.py | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/networkx/drawing/layout.py b/networkx/drawing/layout.py index 6200b3e3..3e7e61ae 100644 --- a/networkx/drawing/layout.py +++ b/networkx/drawing/layout.py @@ -323,9 +323,9 @@ def bipartite_layout( width = aspect_ratio * height offset = (width / 2, height / 2) - top = set(nodes) - bottom = set(G) - top - nodes = list(top) + list(bottom) + top = dict.fromkeys(nodes) + bottom = [v for v in G if v not in top] + nodes = list(top) + bottom left_xs = np.repeat(0, len(top)) right_xs = np.repeat(width, len(bottom)) |