Replace node ID with a label

I have tried out a very simple graph, with dotty.
which is as follows, I would like to know how to display some text content in these nodes in addition to the node id?

I'm trying to build s simple code flow chart from some code., so it can contain text like "a = a+1;", "print('Hello')" ; etc..

digraph G {
start -> a0;
start -> b0;
a1 -> b3;
b2 -> a3;
a3 -> a0;
a3 -> end;
b3 -> end;
start [shape=Mdiamond];
end [shape=Msquare];
}

Replace node ID with a label

Each node has a label attribute that specifies the text displayed for the node. Thus, you can have
  a1 [label="hello"]
By default, a node's label is its id. There are various formatting options for labels, as well as the very general HTML-like labels. See the documentation for more information, especially
http://www.graphviz.org/content/attrs#kescString
http://www.graphviz.org/content/node-shapes#html

Recent comments