Automatic graphical representation of structural information

Presenting structural information as graphics can be a tidious task for human, but, a perfect job for a computer.

In this example, we will install Graphviz on the Ubuntu operating system, which is an open source utility, that can read structural information from text format in the standard dot language and present it in graphics, such as a flowchart, proces or network diagram. It can read from the command line or from a script. It can write to a graphics format, such as PNG, JPG or PDF.

Graphviz is bundled with a number of filters, that draws the structural information in different ways.

  • dot is a filter for drawing directed graphs.
  • neato is a filter for drawing undirected graphs.
  • twopi is a filter for drawing radial layouts of graphs.
  • circo is a filter for drawing circular layout of graphs.
  • fdp is a filter for drawing undirected graphs.

Graphviz is available in the package system of Ubuntu.

sudo apt-get install graphviz

That’s it! We can now draw directly from the command line or in a text file.

echo "digraph G {A->B->C;A->D->E}" | dot -Tpng > abcde.png

nano -w abcde.dot

digraph G
{
A->B->C
A->D->E
}

dot -Tpng -o abcde.png abcde.dot

Print

You can follow any responses to this entry through the RSS 2.0 feed. Both comments and pings are currently closed.

Comments are closed.