I would like to improve my graph. There are problems as follow:
- how to create a consistent graph.the graph itself is not consistent everytime i execute / run the code, it will generate different images. The inconsistent graph is shown in the url.
- how to customize the whole graph / picture size and to make it bigger
- how to set a permanent position for an object 'a' so that it will consistently appears at the first / top position
- how to customize length of arrow for each relationship.
Appreciate if anyone could give some notes or advices
This is my codes:
Unique_liss= ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm']
edgesList= [('a', 'b'), ('b', 'c '), ('c ', 'd'), ('d', 'e'), ('d', 'f'), ('e', 'g'), ('f', 'g'), ('g', 'h'), ('h', 'i '), ('i ', 'j'), ('j', 'k'), ('j', 'l'), ('k', 'm'), ('l', 'm')]
import networkx as nx
g = nx.DiGraph()
g.add_nodes_from(Unique_liss)
g.add_edges_from(edgesList)
nx.to_pandas_adjacency(g)
G = nx.DiGraph()
for node in edgesList:
G.add_edge(*node,sep=',')
A = nx.adjacency_matrix(G).A
nx.draw(G, with_labels=True, node_size = 2000,
node_color = 'skyblue')