graph - Force the left to right order of nodes in graphviz? -
i want draw decision tree chart using graphviz.
the graph want draw looks this:
i using following dot language:
graph { [shape=box; label="a"] b [shape=box; label="b"] al [shape=none; label="0"] bl [shape=none; label="1"] br [shape=none; label="0"] -- al [label="0"]; -- b [label="1"]; b -- bl [label="0"]; b -- br [label="1"]; }
however resulting graph looks this:
how can force left right order of nodes generated graphviz? furthermore, far decision trees go these 2 trees same though left right ordering different?
to fix this, can change order of b
, al
nodes:
graph { [shape=box; label="a"] al [shape=none; label="0"] b [shape=box; label="b"] bl [shape=none; label="1"] br [shape=none; label="0"] -- al [label="0"]; -- b [label="1"]; b -- bl [label="0"]; b -- br [label="1"]; }
by way, graphviz website had blog post problem can have @ if chance.
Comments
Post a Comment