When using networkx.draw()
it is possible to specify different node positioning algorithms that change the graph layout using the pos
keyword argument. For example:
import networkx as nx
import matplotlib.pyplot as plt
# create a graph
G = nx.dodecahedral_graph()
# draw with different layouts
plt.figure()
nx.draw(G,pos=nx.circular_layout(G))
plt.figure()
nx.draw(G,pos=nx.spring_layout(G))
gives you these two different layouts:
Is it possible to do this using pyvis
?