在graphviz - python中是否有一种方法可以绘制一列矩形节点,如下所示:
我希望每个矩形都作为节点,因为这些节点是从前面的代码生成的,我已经绘制了一个节点树。
我已使用此命令
创建了我的节点 tree.node(Taskstr+str(ID))
答案 0 :(得分:0)
The Python code will depend on which library you are using to call Graphviz, but whichever one you use, you want to set the node shape=record
and the label to contain the items of the record between curly braces ('{}') with pipe ('|') characters between each row.
Here's what the dot
file will look like for your first example:
digraph structs {
n1 [shape=record label="{ | | | Task#2 | Task#1 }"]
}
which renders as: