I want to plot my network graph with Networkx
lib.
This is my code:
import networkx as nx
analysis_graph = nx.Graph()
node_list = ["A", "B", "C", "D", "E", "F"]
analysis_graph.add_nodes_from(node_list)
#print(analysis_graph.nodes())
nx.draw(analysis_graph, with_labels = True)
relation_list = [['A', 'B'],
['A', 'C'],
['B', 'D'],
['C', 'E'],
['D', 'F'],
['E', 'D'],
['C', 'E'],
['B', 'D'],
['C', 'F'],
['A', 'E'],
['B', 'C'],
['B', 'F'],
['D', 'A']]
analysis_graph = nx.from_edgelist(relation_list)
print(nx.info(analysis_graph))
nx.draw(analysis_graph, with_labels = True)
My code works, but each time when I run it, it plots different graph. Is there a way to plot it the same each time?