Skip to content

Commit

Permalink
Center locs around zero
Browse files Browse the repository at this point in the history
  • Loading branch information
cvanelteren committed Mar 21, 2024
1 parent caed43e commit d1bc136
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion networkx/drawing/layout.py
Original file line number Diff line number Diff line change
Expand Up @@ -1251,7 +1251,8 @@ def estimate_factor(n, swing, traction, speed, speed_efficiency, jitter_toleranc
else:
return pos

pos_arr = np.random.rand(len(G), dim) * max_pos_range - min_pos_range
# center locs around 0
pos_arr = (np.random.rand(len(G), dim) - 0.5) * (max_pos_range - min_pos_range)

mass = np.zeros(len(G))
size = np.zeros(len(G))
Expand Down

0 comments on commit d1bc136

Please sign in to comment.