The plain and plain-ext formats produce output using a simple, line-based language. The latter format differs in that, on edges, it provides port names on head and tail nodes when applicable.
Example outputs of a simple graph with two nodes connected with an edge:
-Tplain
$ echo 'digraph { a->b }' | dot -Tplain
graph 1 0.75 1.5
node a 0.375 1.25 0.75 0.5 a solid ellipse black lightgrey
node b 0.375 0.25 0.75 0.5 b solid ellipse black lightgrey
edge a b 4 0.375 0.99579 0.375 0.88865 0.375 0.7599 0.375 0.64045 solid black
stop
-Tplain-ext
$ echo 'digraph { a->b }' | dot -Tplain-ext
graph 1 0.75 1.5
node a 0.375 1.25 0.75 0.5 a solid ellipse black lightgrey
node b 0.375 0.25 0.75 0.5 b solid ellipse black lightgrey
edge a b 4 0.375 0.99579 0.375 0.88865 0.375 0.7599 0.375 0.64045 solid black
stop
There are four types of statements.
graph scale width height node name x y width height label style shape color fillcolor edge tail head n x₁ y₁ .. xₙ yₙ [label xl yl] style color stop
Note: The control points given in an edge statement define the body of the edge. In particular, if the edge has an arrowhead to the head or tail node, there will be a gap between the last or first control points and the boundary of the associated node. There are at least 3 possible ways of handling this gap:
dir=none, arrowhead=none, or arrowtail=none for all edges. In this case, the terminating control points will always touch the node.headclip=false or tailclip=false. In this case, the edge will terminate at the node's center rather than its boundary. If arrowheads are used, there will still be a gap, but normally this will occur within the node. The application will still need to clip the spline to the node boundary. Also, as with the previous item, if the edge points to a node port, this technique will fail.The output consists of one graph line, a sequence of node lines, one per node, a sequence of edge lines, one per edge, and a final stop line. All units are in inches, represented by a floating point number.
Note that the plain formats provide minimal information, really giving not much more than node positions and sizes, and edge spline control points. These formats are usually most useful to applications wanting just this geometric information, and willing to fill in all of the graphical details. The only real advantages to these formats is their terseness and their ease of parsing. In general, the dot and xdot are preferable in terms of the quantity of information provided.
© 2025 The Graphviz Authors
Licensed under the Eclipse Public License 1.0.
https://www.graphviz.org/docs/outputs/plain/