如何绘制不同边颜色的相同节点对应两个不同的图?
希望我的问题之前没有被问过。我有两个图,它们的节点相同,但边不同。我想在一张图中绘制两个图。这意味着我有相同的节点,但有两种不同的边缘颜色。但它给了我两个不同的图表。我怎样才能将它们放在一张图中但边缘颜色不同?
Hope my question has not asked before. I have two graphs, which nodes are the same in both of them but edges are different. I want to draw both of graphs in one plot. Which means I have the same nodes, but with two different edge colours. But it gives me two different graphs. How could I have them in one graph but with different edge colours?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
如果您使用 Python、NetworkX 和 Matplotlib,那么您可以执行类似的操作,其中您有两个具有相同节点集的图形,因此您首先绘制节点,然后用不同颜色绘制两组边。
请注意相同端点之间不同颜色的边缘,它们将无法区分。
If you are using Python, NetworkX and Matplotlib then you can do something like this, where you have two graphs with the same set of nodes and so you draw first the nodes and then the two set of edges in different colors.
Take care with edges of different colors between the same endpoints, they will be indistinguishable.