Graph graph graphviz vertically

I use graphviz to draw oriented graphs. Now the fact is that, although I can correctly generate a graph, the graph is designed horizontally, which does not meet my requirements. So how to draw oriented graphics vertically Please help me with this

+7
graphviz
source share
3 answers

Given the following script, which I extracted from the comments on the question and edited to make it successful by removing some extraneous semicolons:

digraph G { graph [ bgcolor=lightgray, resolution=128, fontname=Arial, fontcolor=blue, fontsize=10 ]; node [ fontname=Arial, fontcolor=blue, fontsize=10]; edge [ fontname=Helvetica, fontcolor=red, fontsize=10 ]; "arunachaltourism.com/" -> "webcomindia.biz/profile.php"; "arunachaltourism.com/#" -> "arunachaltourism.com/"; "arunachaltourism.com/aalo.php" -> "arunachaltourism.com/"; } 

I called the script x.dot . Now, working:

 dot x.dot -Tjpg -o x.jpg 

... produces:

enter image description here

... because the default is rankdir=BT . Insert:

 rankdir=LR 

... since the second line of the script and running the script through dot again gives:

enter image description here

Thus, it is not clear to me why the chart could have been horizontally aligned for the first time, but you can see how using rankdir can make the chart go either horizontally or vertically.

+10
source share

(old question, but why not!)

You can also run:

 dot -Grankdir=LR -Tpng myfile.dot -ogeneratedpng.png 
+7
source share

You can use rankdir as a property in the dot file:

 digraph G { rankdir=LR; //left to right //B bottom T top L left R right start->a1; a1 -> b3; b2 -> a3; a3 -> a0; a3 -> end; b3 -> end; } 

script generate the following graph from left to right:

You can try the script online enter image description here

0
source share

All Articles