:
지금까지 가능한 솔루션 같아이 노드이고 값은 2- 튜플 (좌표)입니다. 어떤 방법을, 당신은 다음이 좌표 추가로 조작 할 수 있습니다
In [101]: pos
Out[101]:
{(0, 0): array([ 0.70821816, 0.03766149]),
(0, 1): array([ 0.97041253, 0.30382541]),
(0, 2): array([ 0.99647583, 0.63049339]),
(0, 3): array([ 0.86691957, 0.86393669]),
(1, 0): array([ 0.79471631, 0.08748146]),
(1, 1): array([ 0.71731384, 0.35520076]),
(1, 2): array([ 0.69295087, 0.71089292]),
(1, 3): array([ 0.63927851, 1. ]),
(2, 0): array([ 0.42228877, 0. ]),
(2, 1): array([ 0.33250362, 0.3165331 ]),
(2, 2): array([ 0.31084694, 0.69246818]),
(2, 3): array([ 0.34141212, 0.9952164 ]),
(3, 0): array([ 0.16734454, 0.11357547]),
(3, 1): array([ 0.01560951, 0.33063389]),
(3, 2): array([ 0. , 0.63044189]),
(3, 3): array([ 0.12242227, 0.85656669])}
을하시기 바랍니다 : 여기에 pos
DICT의 모양에 대한 예제입니다. 예를 들어, x
및 y
때문에 spring_layout
의해 반환 좌표를 0과 1 사이에있는 경우 레이어로 노드를 분리하는 y
-coordinate 10 배 층 레벨 값을 추가 할 수
for node in pos:
level = node // nodes_per_layer
pos[node] += (0,10*level)
import networkx as nx
import matplotlib.pyplot as plt
layers = 5
nodes_per_layer = 3
n = layers * nodes_per_layer
p = 0.2
G = nx.fast_gnp_random_graph(n, p, seed=2017, directed=True)
pos = nx.spring_layout(G, iterations=100)
for node in pos:
level = node // nodes_per_layer
pos[node] += (0,10*level)
nx.draw(G, pos, node_size=650, node_color='#ffaaaa', with_labels=True)
plt.show()
당신이 원하는 결과를 예를 들어 이미지를 게시 할 수 
을 생산? – edo