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:

enter image description here

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:

enter image description here

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

Popular posts from this blog

jquery - How do you format the date used in the popover widget title of FullCalendar? -

asp.net mvc - SSO between MVCForum and Umbraco7 -

Python Tkinter keyboard using bind -