Reputation: 21
I used networkx to visualize a bipartite graph but the result was unsatisfactory (i.e. nodes, text and edge labels overlapping). Now I am trying to use the pyviz library (https://pyviz.org/). The visual problems are now resolved but I can't find a way to separate the right and left side nodes in the outcome graph. Any suggestions on how can I make a nice looking bipartite graph in pyviz, or any other library?
Thank you in advance.
Upvotes: 1
Views: 471
Reputation: 177
Was there some reason the dedicated bipartite layout did not work for you in networkX?
See the example from the documentation below:
import networkx as nx
G = nx.bipartite.gnmk_random_graph(3, 5, 10, seed=123)
top = nx.bipartite.sets(G)[0]
pos = nx.bipartite_layout(G, top)
nx.draw(G, pos, with_labels=True)
Resulting in the below layout:
Hope this helps.
Upvotes: 0