LinuxCommandLibrary

dot

TLDR

Render graph to PNG image

$ dot -Tpng [graph.dot] -o [output.png]
copy
Render to SVG
$ dot -Tsvg [graph.dot] -o [output.svg]
copy
Render to PDF
$ dot -Tpdf [graph.dot] -o [output.pdf]
copy
Render from stdin
$ echo "digraph { A -> B }" | dot -Tpng -o [output.png]
copy
Use specific layout engine
$ dot -Kneato [graph.dot] -Tpng -o [output.png]
copy
Render with custom DPI
$ dot -Gdpi=[300] -Tpng [graph.dot] -o [output.png]
copy

SYNOPSIS

dot [options] [files]

DESCRIPTION

dot is the primary program for rendering directed graphs from Graphviz. It reads graph descriptions in the DOT language and produces visual representations in various output formats.
The DOT layout engine arranges nodes hierarchically, making it ideal for directed graphs like flowcharts, dependency diagrams, and state machines. Alternative engines (neato, fdp, circo) provide different layout algorithms.
dot supports extensive customization through graph, node, and edge attributes controlling colors, shapes, fonts, and positioning.

PARAMETERS

FILES

Input DOT files to process.
-TFORMAT
Output format: png, svg, pdf, ps, etc.
-o FILE
Output file name.
-KENGINE
Layout engine: dot, neato, fdp, circo, twopi.
-GNAME=VALUE
Set graph attribute.
-NNAME=VALUE
Set default node attribute.
-ENAME=VALUE
Set default edge attribute.
-V
Print version.

CAVEATS

Complex graphs may require manual positioning hints. Some output formats need additional libraries. Very large graphs may be slow to render or produce cluttered output.

HISTORY

dot is part of Graphviz, originally developed at AT&T Labs Research starting in 1991. Graphviz was released as open source in 2000 and remains the standard tool for graph visualization.

SEE ALSO

neato(1), circo(1), fdp(1), graphviz(7)

Copied to clipboard