How can I generate rectangle style edges instead of curves in GraphViz?

Yatin Kumbhare picture Yatin Kumbhare · Jan 20, 2012 · Viewed 10.9k times · Source

I have generated Graphviz images with the dot language using the Pydot Python library.

Generated Graphviz Graph

But the edges are getting draw in curves, and I need this kind of output:

Expected Graphviz

Please provide a solution using Graphviz.

Answer

ryandesign picture ryandesign · Jan 29, 2012

This feature is called "orthogonal edge routing" and is available in Graphviz versions from September 28, 2010 and newer. Use "graph [splines=ortho]"; see the Graphviz documentation.

digraph Orthogonal {
  graph [label="Orthogonal edges", splines=ortho, nodesep=0.8]
  node [shape=box]
  a->{b c}
  b->{d e}
  c->{f g}
}

enter image description here