Questions tagged [dot]

DOT is both a mathematical graph description language and a particular graph rendering engine (dot). As a graph description language, DOT uses a simple plain text mapping syntax to describe the relationships between nodes and edges (e.g. `nodeA -> nodeB`) , and a plain text markup syntax to add style, annotations, and constrain the rendered layout.

DOT is a plain text graph description language. It is a simple way of describing graphs that both humans and computer programs can use.

The following Example:

digraph g{

    // basic: A,B,C,D  (this is a comment)
    A -> B -> C -> D
    D -> C
    B -> D

    // node and edge markups
    nodeA [shape=diamond, color=red, style=dashed, label="Warehouse 259"]
    nodeA -> nodeB [color=blue, style=solid, label="MWF schedule, 2 ton capacity"]

}

will render to this graph:

enter image description here

DOT graphs are typically files that end with the .gv (preferred) or .dot extension.

Most uses of DOT are either by GraphViz programs or by software that uses GraphViz internally.

1075 questions
32
votes
4 answers

How can I control within level node order in graphviz's dot?

I have a graph that has a tree as its backbone. So I have, for example a node A with children B, C, and D. Assuming the graph is being drawn top-down, A will be on one level, then B, C, and D. I would like to force graphviz to lay them out in B,…
Robert P. Goldman
  • 860
  • 1
  • 8
  • 16
30
votes
2 answers

How do I get DOT to display an image for a node?

I am not having success displaying an image at a node in dot. My node is defined: SW103 [image="swOpen.png"] I can view swOpen.png so I think the file is ok, and it is in the same directory as the code. But dot displays the node using its label…
kathleen gould
  • 333
  • 1
  • 3
  • 7
30
votes
1 answer

group nodes with subgraphs

I'd like to group some nodes with the following code digraph dataflow { subgraph pipeline { relations; synonyms; articles; } subgraph lucene { index; search; } training_data - > index; …
Reactormonk
  • 21,472
  • 14
  • 74
  • 123
28
votes
2 answers

Changing edge direction in dot

I'm trying to draw a pretty simple diagram in dot. digraph untitled { rankdir = LR; {rank=same; S; A} B -> A; B -> S; A -> A; S -> S; A -> S ; S -> A; A -> T; S -> T; } The results I get is I really have…
JoFrhwld
  • 8,867
  • 4
  • 37
  • 32
28
votes
1 answer

Graphviz Dot Algorithm

Is there any documentation (full pseudo code?) on the algorithm from dot within the Graphviz Library? I only found some partial pseudo code documentation.
RaphaelH
  • 2,144
  • 2
  • 30
  • 43
28
votes
3 answers

dot: dash in name

Is it possible to have a dash in the node name? I tried escaping with backslash (searching the web didn't helped either). Example: digraph test { some-name -> other-name; }
Dag
  • 10,079
  • 8
  • 51
  • 74
27
votes
2 answers

How to manage distance between nodes in graphviz?

I am trying to plot a graph with 3 levels of nodes, with equal distances between the levels. However, graphviz somehow decides that the distance between the middle level and the bottom one should be much larger than the distance between the top and…
Cantfindname
  • 2,008
  • 1
  • 17
  • 30
26
votes
1 answer

Creating Straight Edges in Graphviz

I want to create a flowchart (similar to Visio) using Graphviz. Here is a sample digraph. digraph start_up { node [style = rounded]; node [shape = rect] start end; node [style = ""]; node [shape = diamond] "USB\nCommand\nArrived"; start ->…
oliverks
  • 261
  • 1
  • 3
  • 4
26
votes
3 answers

Graphviz (DOT) Captions

I need to print a large number of graphs using Graphviz DOT. To distinguish which input each graph corresponds to, I want to also have a caption for each graph. Is there anyway to embed this into the DOT representation of the graphs.
myahya
  • 3,079
  • 7
  • 38
  • 51
26
votes
2 answers

Forcing "main line" nodes into a straight line in Graphviz (or alternatives)

I'm trying to use Graphviz dot (but am willing to use something else) to generate a graph with a long "main line" of nodes, and many small branches. I'd like the main line to be straight from left to right, with the small branches above or below it.…
Chad Birch
  • 73,098
  • 23
  • 151
  • 149
25
votes
1 answer

Graphviz dot: How to change the colour of one record in multi-record shape

I have the following dot sample. I would like to give the first section in each record (the table name) a different background and foreground colour. I can't find any examples of how to do this for a record. Basically I want the table name in the…
Superdooperhero
  • 7,584
  • 19
  • 83
  • 138
24
votes
3 answers

Graphviz: Place edge label on the other side

This may be related to How to place edge labels ON edge in graphviz: I have the following graph, which I visualize using the command dot -Teps g.dot > g.eps: graph triple { node [shape=box]; User; Object; Tag; node…
l0b0
  • 55,365
  • 30
  • 138
  • 223
22
votes
2 answers

How can I dump an abstract syntax tree generated by gcc into a .dot file?

I think the question's title is self-explanatory, I want to dump an abstract syntax tree generated by gcc into a .dot file (Those files generated by Graphviz) because then I want to view it in a .png file or similar. Is there any way I can do that?
asdrubalivan
  • 1,149
  • 2
  • 9
  • 17
22
votes
1 answer

Enforcing horizontal node ordering in a .dot tree

I am trying to recreate an example diagram for a binary search tree with GraphViz. This is how it should look in the end: This is my first attempt: digraph G { nodesep=0.3; ranksep=0.2; margin=0.1; node [shape=circle]; edge…
0__
  • 66,707
  • 21
  • 171
  • 266
21
votes
5 answers

Remove rectangle from Graphviz Dot cluster subgraph

Is there a way to tell Dot to use a cluster but not show the rectangle around the subgraph nodes?
mdashx
  • 1,335
  • 2
  • 10
  • 12
1 2
3
71 72