我想为每个检测到的社区绘制一个带有彩色节点的网络(我已经有每个社区的节点列表)
我现在的情况是这样的:
plot = nx.draw(G3, nodecolor='r', node_color= 'white', edge_color='k',
with_labels=True, font_weight='light', node_size= 280, width= 0.9)
plt.savefig('graphe.png')
plt.show()
我如何才能以每个社区都有特定颜色的方式来实现它?在
Tags:
你很亲密。你只需要绘制一组节点,一次一个社区。 另外,由于我们是一步一步地绘制它,所以我们必须确定节点的位置。 为此,我们使用
nx.spring_layout()
下面是一个有效的示例,可以帮助您使用虚拟数据。在
有什么不清楚的,请问一下。在
相关问题 更多 >
编程相关推荐