我想绘制一个多路复用网络,但希望将每一层的节点排成一行(作为路径)。
到目前为止,我的代码如下,但是它在正方形位置上绘制的节点更多。我想固定他们的位置(即使手动),以便他们排成一行。
import string
import random
import numpy as np
# setting initial conditions
alphabet = string.ascii_lowercase
n_countries = 4
n_layers = 3
layer_name = [alphabet[i] for i in range(n_layers)]
# making categorial multiplex
coupling_weight = 1
cnet = MultiplexNetwork(couplings=('categorical',coupling_weight))
# adding nodes
for i in range(n_countries):
cnet.add_node(i)
# adding layers
for l in layer_name:
cnet.add_layer(l)
# adding edges
for l in range(n_layers):
cnet[l ,(l + 1) % n_countries,alphabet[l],alphabet[l]] = 1
# plotting
random.seed(3)
fig = draw(cnet,show=True)