Tuesday, June 21, 2011

Graphviz: dot

In this blog post I will discuss the programming language dot.

Dot is a graph description language. I will dive right in and show you an example. The following code:

graph example {
    a [label="root"]
    b [shape="box"]
    c [color="red"]
 
    a -- b -- d
    a -- c -- e
    c -- f [label="indirect"]
}
produces this output:

This clearly shows the capabilities of dot. For more information about dot, and it companion programs visit the Graphviz website.

2 comments:

  1. Cute language indeed. I forced myself to learn a little PostScript 3 years ago to create a bizarre Christmas postcard (something I do each year, you can find some in my blog) and thus I would not use this... But looks neat for quickly producing graphs from programs, PostScript is not as straightforward (being a stack language is a PITA).

    Cheers,

    Ruben @mostlymaths.net

    ReplyDelete
  2. Dot is definitely well suited for graph visualisation. But is is only suited for this task.

    I also learned PostScript. It is a wonderful language because can create stunning visuals very easy. I even used to create scoring forms for an relay race math game. (100 teams with 25 questions per team)

    I will share one of my Postscript tricks maybe you will find them interesting.

    ReplyDelete