Daniel@0: Daniel@0: Daniel@0: Daniel@0: Command-line Usage Daniel@0: Daniel@0: Daniel@0: Daniel@0:

Command-line Invocation

Daniel@0:
Daniel@0: All Graphviz programs have a similar invocation:
Daniel@0:
Daniel@0: cmd [ flags ] [ input files ] Daniel@0:
Daniel@0: If no input files are supplied, the program reads from stdin. Daniel@0:

Flags

Daniel@0:
Daniel@0:
-Gname[=value] Daniel@0:
Set a graph attribute, with default value = true. Daniel@0:
-Nname[=value] Daniel@0:
Set a default node attribute, with default value = true. Daniel@0:
-Ename[=value] Daniel@0:
Set a default edge attribute, with default value = true. Daniel@0:
-Klayout Daniel@0:
Specifies which default layout algorithm to use, overriding the default from the command name. For example, running Daniel@0: dot -Kneato is equivalent to running neato. Daniel@0:
-Tformat[:renderer[:formatter]] Daniel@0:
Set output language to one of the supported formats. Daniel@0: By default, attributed dot is produced. Daniel@0:

Daniel@0: Depending on how Graphviz was built, there may be multiple renderers for Daniel@0: generating a particular output format, and multiple formatters for Daniel@0: creating the final output. For example, a typical installation Daniel@0: can produce PNG Daniel@0: output using either the Cairo or GD library. The desired rendering engine Daniel@0: can be specified after a colon. If there are multiple formatting engines Daniel@0: available, the desired one can be specified in a similar fashion after Daniel@0: the rendering engine. Thus, -Tpng:cairo specifies PNG Daniel@0: output produced by Cairo (using the Cairo's default formatter), and Daniel@0: -Tpng:cairo:gd specifies PNG Daniel@0: output produced by Cairo formatted using the GD library. Daniel@0:

Daniel@0: If no renderer is specified, or a renderer but no formatter, the default one Daniel@0: is invoked. The flag -Tformat: produces a list of all Daniel@0: of the renderers available for the specified format, the first one Daniel@0: listed with a prefix matching format being the default. Daniel@0: Using the -v flag, described below, will print which format, Daniel@0: renderer, and formatter are actually used. Daniel@0:

-V Daniel@0:
Emit version information and exit. Daniel@0:
-llibrary Daniel@0:
User-supplied, device-dependent library text. Multiple flags may Daniel@0: be given. These strings are passed to the code generator at the Daniel@0: beginning of output. Daniel@0:

For PostScript output, they are treated as file names Daniel@0: whose content will be included in the preamble after the standard preamble. Daniel@0: If library is the empty string "", the standard preamble Daniel@0: is not emitted. Daniel@0:

-n[num] Daniel@0:
Sets no-op flag in neato. Daniel@0: If set, neato assumes nodes have already been Daniel@0: positioned and all nodes have a pos Daniel@0: attribute giving Daniel@0: the positions. It then performs an optional adjustment to remove node-node Daniel@0: overlap, depending on the value of the Daniel@0: overlap attribute, computes the edge Daniel@0: layouts, depending on the value of the Daniel@0: splines attribute, and Daniel@0: emits the graph in the appropriate format. If num is supplied, Daniel@0: the following actions occur: Daniel@0:
Daniel@0:
num = 1 Daniel@0:
Equivalent to -n. Daniel@0:
num > 1 Daniel@0:
Use node positions as specified, with no adjustment to Daniel@0: remove node-node overlaps, and use any edge layouts already specified Daniel@0: by the pos attribute. neato Daniel@0: computes an edge layout for any edge that does not have a pos attribute. Daniel@0: As usual, edge layout is guided by the Daniel@0: splines attribute. Daniel@0:
Daniel@0:
-ooutfile Daniel@0:
Write output to file outfile. By default, output goes to Daniel@0: stdout. Daniel@0:
-O Daniel@0:
Automatically generate output file names based on the input Daniel@0: file name and the various output formats specified by the -T Daniel@0: flags. Daniel@0:
-P Daniel@0:
Automatically generate a graph that shows the plugin configuration of Daniel@0: the current executable. e.g. dot -P -Tps | lpr Daniel@0:
-q Daniel@0:
Suppress warning messages. Daniel@0:
-s[scale] Daniel@0:
Set input scale to scale. If this value is omitted, Daniel@0: 72.0 is used. This number is used to convert the point coordinate Daniel@0: units used in the pos attribute Daniel@0: into inches, which is what is expected by neato and fdp. Daniel@0: Thus, feeding the output of a graph laid out by one program into Daniel@0: neato or fdp almost always requires this flag. Daniel@0: Ignored if the -n flag is used. Daniel@0:
-v Daniel@0:
Verbose mode Daniel@0:
-x Daniel@0:
In neato, on input, prune isolated nodes and peninsulas. Daniel@0: This removes uninteresting graph structure and produces a less cluttered Daniel@0: drawing. Daniel@0:
-y Daniel@0:
By default, the coordinate system used in generic output formats, Daniel@0: such as attributed dot, Daniel@0: extended dot, Daniel@0: plain and Daniel@0: plain-ext, Daniel@0: is the standard cartesian system with the origin in the lower left corner, Daniel@0: and with increasing y coordinates as points move from bottom to top. Daniel@0: If the -y flag is used, the coordinate system is inverted, Daniel@0: so that increasing values of y correspond to movement from top to bottom. Daniel@0:
-? Daniel@0:
Print usage information, then exit. Daniel@0:
Daniel@0: If multiple -T flags are given, drawings of the graph Daniel@0: are emitted in each of the specified formats. Multiple -o Daniel@0: flags can be used to specify the output file for each format. If there Daniel@0: are more formats than files, the remaining formats are written to Daniel@0: stdout. Daniel@0:

Daniel@0: Note that the -G, Daniel@0: -N and Daniel@0: -E flags override any initial attribute declarations Daniel@0: in the input graph, Daniel@0: i.e., those attribute statements appearing before any node, edge or Daniel@0: subgraph definitions. Daniel@0: In addition, these flags cause the related attributes to be permanently Daniel@0: attached to the graph. Thus, if attributed dot is used for Daniel@0: output, the graph will have these attributes. Daniel@0:

Environment Variables

Daniel@0:
Daniel@0:
GDFONTPATH Daniel@0:
Daniel@0: List of pathnames giving directories which a program should search for fonts. Daniel@0: Overridden by DOTFONTPATH. Daniel@0: Used only if Graphviz is not built with the fontconfig library Daniel@0:
DOTFONTPATH Daniel@0:
Daniel@0: List of pathnames giving directories which a program should search for fonts. Daniel@0: Overridden by fontpath. Daniel@0: Used only if Graphviz is not built with the fontconfig library Daniel@0:
SERVER_NAME Daniel@0:
Daniel@0: If defined, this indicates that the software is running as a web application, Daniel@0: which restricts access to image files. See Daniel@0: GV_FILE_PATH. Daniel@0:
GV_FILE_PATH Daniel@0:
Daniel@0: If SERVER_NAME is defined, image files are Daniel@0: restricted to the directory specified by GV_FILE_PATH. Daniel@0: Note that sometimes, when using one of the layout programs in a web Daniel@0: script, it is not enough to use an export command but rather the Daniel@0: variables should be set when the command is run, for example,
Daniel@0: Daniel@0: SERVER_NAME=xxx GV_FILE_PATH="images/" dot -Tpng -o x.png x.dot Daniel@0: Daniel@0:
GVBINDIR Daniel@0:
Daniel@0: Indicates which directory contains the Graphviz config file and Daniel@0: plug-in libraries. If it is defined, the value overrides any other Daniel@0: mechanism for finding this directory. If Graphviz is properly installed, Daniel@0: it should not be needed, though it can be useful for relocation on Daniel@0: platforms not running Linux or Windows. Daniel@0:
Daniel@0: Daniel@0: