[Note, 20130510: The posting below is correct, but I now maintain information in my Notes collection — see the current note or visit the search page for the Notes collection and search for "graph or "automaton", etc.]
The language Dot describes graphs in plain text. It is used with the Graphviz graphic application; both were originally developed at Bell Labs.
Below are a few notes on surprises I had when working with .dot
and
.svg
("Scalable Vector Graphics", a standard XML-based format for
graphs) files in Python:
- For viewing
.svg
files, desktop installations of Ubuntu use the Gnome viewer "Eye of GNOME" (eog
) by default. -
Ubuntu's (Lucid) server installation of graphviz does not include a viewer by default. You can display
.svg
files using Firefox; set the browser toabout:config
and confirm that you have the settingsvg.smil.enabled;true
and place an entry in your~/.mailcap
file:image/svg+xml; firefox
Of course, you can also install
eog
on your server. -
The current Mac version of Graphviz (v. 2.28) has no trouble opening a
.dot
file, but apparently it cannot open.svg
files.
For use within LaTeX documents, it is possible to do everything native packages or (more interestingly) to incorporate Graphviz output by converting it to a native format:
- The native LaTeX tools for producing flowcharts and automata are the
tikz
andpstricks
packages. TikZ, which has more comprehensive support, supplies a library calledautomata
(see the TikZ manual for detailed instructions. There is also a third library, [VauCanSon-G
][], but it appears to have less functionality. - There is a Python module,
dot2tex
by Kjell Magne Fauske, that converts.dot
and other Graphviz formats to TikZ or pstricks. - Fauske has also written a [LaTeX package,
dot2texi
][], that allows.dot
(etc.) graphical output to be embedded directly in a LaTeX document.