I am using python networkx lib draw a node relation graph. Code like this:
import networkx as nx
import matplotlib.pyplot as plt
G = nx.Graph()
G.add_edges_fro
You could set the scale
parameter in nx.spring_layout to a low value to scale down the positions. It basically applies a scale factor to the node positions, so the nodes are positioned in a box of size [0,scale]
. Here's an example:
pos = nx.spring_layout(G, scale=0.2)
nx.draw_networkx_nodes(G,pos)
nx.draw_networkx_edges(G,pos)
y_off = 0.02
nx.draw_networkx_labels(G, pos = {k:([v[0], v[1]+y_off]) for k,v in pos.items()})