6 local function printf(fmt
, ...)
7 print(string.format(fmt
, ...))
13 local g
= gr
.open("G")
15 node
= {shape
= "circle", color
= "blue"},
16 edge
= {color
= "green"}
19 -- Create a subgraph with different prototype
21 local sg
= g
:subgraph("SG")
23 node
= {shape
= "box", color
="red"},
27 -- Some nodes and edges
29 g
:edge
{"n1", "n2", label
= "n1=>n2"}
30 sg
:edge
{"n3", "n4", label
= "n3=>n4"}
31 g
:edge("n1", "n4", "n1=>n4")