Reputation: 428
Is there a way in graphviz - python to draw a column of rectangular nodes, like this:
I want each rectangle as node since these nodes are generated from a previous code where I already drew a tree of nodes.
I have created my nodes using this command
tree.node(Taskstr+str(ID))
Upvotes: 1
Views: 2430
Reputation: 4855
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:
Upvotes: 1