I have started working with networkx lib a few days ago. I'm wondering if its possible to change length of the edges on the graph? I have plotted a graph but nodes are very close one to another, so node names are overlapping (check the image below). This is my code:
import networkx as nx
import matplotlib.pyplot as plt
# Defining graph .Graph() and .DiGraph()
analysis_graph = nx.DiGraph()
# Adding relations to the graph
analysis_graph.add_edges_from(relation_list)
# extracting nodes from relations - Unique node entities
node_list = list(nx.nodes(analysis_graph))
print(type(node_list))
# Creating sizes for each node (degree - number of relations from each node)
dict_of_node_sizes = dict(analysis_graph.degree) # for getting node sizes
print(dict_of_node_sizes)
# Same graph each time
my_pos = nx.spring_layout(analysis_graph.to_undirected(), seed = 0)
#.to_undirected() -> Making shape of directed graph like undirected graph
# Printing graph info
print(nx.info(analysis_graph))
# Printing graph
plt.figure(figsize=(25,17))
nx.draw(analysis_graph,
pos = my_pos,
with_labels = True,
arrowsize=10,
font_size=10,
node_size=[(v+1) * 120 for v in dict_of_node_sizes.values()])
This is my graph:
Do you know how I can fix the look of the graph so that nods are clearly visible? Should I make longer edges (how) or should I change the fonts, or something else?