The University of Queensland Homepage
School of ITEE ITEE Main Website

 Dotty (graph package)

Using and Printing Dotty Files

Dotty is a nifty program for displaying graphs from simple files describing the nodes and their edges. It is available from AT&T at this address: http://www.research.att.com/sw/tools/graphviz. It is now open source. Binary versions are available for Linux, Windows, various Unix platforms, and Apple.

Note: it is not obvious where $LEFTYPATH should be set (Unix versions). It seems that it should be set to wherever the dotty.lefty file is.

To get rid of the silly blobs on the edges, find the dotty.lefty file and change edgehandles=1 to edgehandles=0. If you can't edit that file, copy that directory, make the change there, and point $LEFTYPATH to that directory.

To print a dotty file sensibly, you need to use dot rather than dotty, e.g.:

dot -Gpage="8.0,11.0" -Gratio=auto -Tps -o out.ps uqbt.dot
This selects A4 paper size (expressed in inches, with about 0.3"x0.7" margins), and the key thing is the auto sizing with "ratio=auto". The output is in the postscript file out.ps, which can be printed. It will be at a sensible size (no more than 50% shrinking) on multiple pages. For more information on dotty, see the user guide (internal link only, but you can get this from the AT&T site). If your printout has a strip missing (e.g. top edge), repeat with a smaller page size (margin= doesn't seem to work for me). For dertails, see the online documentation.

You can also place the page and ratio commands in each .dot file; this will not affect viewing with dotty. For example:

digraph todot_output {
ratio=auto;
page="8.0,11.0"
"main" [shape=box,style=filled,color=yellow]; 19 [shape=triangle,label="2: ret"];
That way, you can skip the two -G switches when converting the graph to postscript. Note the shape, style, and color options.

If you actually want to force everything on one page, use size= instead of page=. If you want a size between what page= and what size= gives, you can give both a page= and a size=, but don't specify ratio=auto. It often seems to overflow the given size, though, so much experimentation is required at times.

To print in landscape mode, you can swap the 8.0 and 11.0 above. This will produce a postscript file that is wider than tall; you may have trouble printing it properly. To print a graph that fits best on one A4 page in landscape mode, you can use the "print graph" option in dotty (right mouse button), and print to file. (Note: in some versions, the right mouse button menu is broken).