【发布时间】:2021-01-21 12:14:38
【问题描述】:
我正在使用具有 circular layout 的 Networkx 图。我想在彼此靠近的节点之间弯曲边缘以循环到图的中间并返回。 像这样的:
我正在使用此代码来弯曲边缘并更改半径值,但无论我应用什么半径,我都没有得到我想要的那么大的曲线。
for edge in G.edges():
source, target = edge
rad = 0.35
arrowprops=dict(lw=G.edges[(source,target)]['weight'],
arrowstyle="-",
color='blue',
connectionstyle=f"arc3,rad={rad}",
linestyle= '-',
alpha=0.6)
ax.annotate("",
xy=pos[source],
xytext=pos[target],
arrowprops=arrowprops
)
使用上述代码的相邻节点之间的边缘如下所示:
【问题讨论】:
标签: python matplotlib networkx