Command Line

DOT rendering programs and utilities.

All Graphviz programs have a similar invocation:

cmd [ flags ] [ input files ]

For example:

$ dot -Tsvg

If no input files are supplied, the program reads from stdin. For example:

$ echo 'digraph { a -> b }' | dot -Tsvg > output.svg




Set a graph attribute, with default value = true

For example,

$ echo 'digraph { a -> b }' | dot -Tsvg -Gfontcolor=red -Glabel="My favorite letters"

Overrides the default fontcolor and label attributes of the graph, producing a red legend:


Set a default node attribute, with default value = true.

For example,

$ echo 'digraph { a -> b }' | dot -Tsvg -Nfontcolor=red -Nshape=rect

Overrides the default node fontcolor and shape attributes, producing rectangular nodes with red text:


Set a default edge attribute, with default value = true.

For example,

$ echo 'digraph { a -> b }' | dot -Tsvg -Ecolor=red -Earrowhead=diamond

Overrides the default edge color and arrowhead attributes, producing red edges with a diamond arrowhead:


Specifies which default layout engine to use, overriding the default from the command name. For example, running dot -Kneato is equivalent to running neato.


Set output language to one of the supported formats. By default, attributed dot is produced.

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

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


Emit version information and exit. For example:

$ dot -V
dot - graphviz version 2.47.1 (20210417.1919)


User-supplied, device-dependent library text. Multiple flags may be given. These strings are passed to the code generator at the beginning of output.

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


Sets no-op flag in neato. If set, neato assumes nodes have already been positioned and all nodes have a pos attribute giving the positions. It then performs an optional adjustment to remove node-node overlap, depending on the value of the overlap attribute, computes the edge layouts, depending on the value of the splines attribute, and emits the graph in the appropriate format. If num is supplied, the following actions occur:

num = 1
Equivalent to -n.
num > 1
Use node positions as specified, with no adjustment to remove node-node overlaps, and use any edge layouts already specified by the pos attribute. neato computes an edge layout for any edge that does not have a pos attribute. As usual, edge layout is guided by the splines attribute.


Write output to file outfile. For example,

$ echo 'digraph { a -> b }' | dot -Tsvg -o output.svg

Generates output.svg:

By default, output goes to stdout.


Automatically generate output file names based on the input file name and the various output formats specified by the -T flags.

For example,

$ dot -Tsvg -O ~/ ~/

Generates ~/ and ~/ files.


Automatically generate a graph that shows the plugin configuration of the current executable. e.g.

$ dot -P -Tsvg -o plugins.svg


Suppress warning messages.


Set input scale to scale. If this value is omitted, 72.0 is used. This number is used to convert the point coordinate units used in the pos attribute into inches, which is what is expected by neato and fdp. Thus, feeding the output of a graph laid out by one program into neato or fdp almost always requires this flag. Ignored if the -n flag is used.


Verbose mode


In neato, on input, prune isolated nodes and peninsulas. This removes uninteresting graph structure and produces a less cluttered drawing.


By default, the coordinate system used in generic output formats, such as attributed dot, extended dot, plain and plain-ext, is the standard cartesian system with the origin in the lower left corner, and with increasing y coordinates as points move from bottom to top. If the -y flag is used, the coordinate system is inverted, so that increasing values of y correspond to movement from top to bottom.


Print usage information, then exit.

If multiple -T flags are given, drawings of the graph are emitted in each of the specified formats. Multiple -o flags can be used to specify the output file for each format. If there are more formats than files, the remaining formats are written to stdout.

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

Environment Variables


List of pathnames giving directories which a program should search for fonts. Overridden by DOTFONTPATH. Used only if Graphviz is not built with the fontconfig library


List of pathnames giving directories which a program should search for fonts. Overridden by fontpath. Used only if Graphviz is not built with the fontconfig library


If defined, this indicates that the software is running as a web application, which restricts access to image files.


Indicates which directory contains the Graphviz config file and plug-in libraries. If it is defined, the value overrides any other mechanism for finding this directory. If Graphviz is properly installed, it should not be needed, though it can be useful for relocation on platforms not running Linux or Windows.


Make directed graphs acyclic.


Biconnected components filter for graphs.


Connected components filter for graphs.


Find clusters in a graph and augment the graph with this information.


Calculates intersection between two images.


Single-source distance filter.


A customizable graph editor.


Edge coloring to disambiguate crossing edges.


Count graph components.


GML-DOT converters.


GRAPHML-DOT converter.


GXL-GV converters.


Flow colors through a ranked digraph.


Simple graph editor and viewer.


Generate graphs.


Find clusters and create a geographical map highlighting clusters.


Merge and pack disjoint graphs.


Graph pattern scanning and processing language.


GXL-GV converters.


A programmable graphics editor.


A customizable graph editor.


Fast edge bundling.


Matrix Market-DOT converters.


Pretty-print graph file.


Extract strongly connected components of directed graphs.


Interactive graph viewer.


Transitive reduction filter for directed graphs.


Adjust directed graphs to improve layout aspect ratio.


Combined text editor and dot viewer.