我試圖在不同的頂點設置文本並繪製它們,但我不知道如何製作它。 我搜索graph_tool documentaction但我不能找出如何做,因爲例子有這麼糊塗... 我的代碼是: from graph_tool.all import *
g = Graph()
g.add_vertex()
// How to something like: g.vertex(0).text = "A"
我想在graph-tool圖中存儲一個類的實例,每個節點有一個對象(或圖形工具調用它們的「頂點」)。我試圖使用頂點屬性,因爲這似乎是way to do this。 class MyClass(object):
def __init__(self, title):
self.title = title
graph = Graph()
my_obj = MyClass('s