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.

941 questions
491
votes
11 answers

Graphviz: How to go from .dot to a graph?

I can't seem to figure this out. I have a .dot file, which is valid according to the syntax. How do I use graphviz to convert this into an image? (note that I'm on Windows, not linux)
Nick Heiner
  • 108,809
  • 177
  • 454
  • 689
188
votes
4 answers

How to add edge labels in Graphviz?

I am trying to draw a graph using Graphviz, but I need to add labels on the edges. There does not seem to be any way to that in Graphviz. Are there a way out?
user855
  • 16,878
  • 34
  • 86
  • 143
186
votes
3 answers

GraphViz - How to connect subgraphs?

In the DOT language for GraphViz, I'm trying to represent a dependency diagram. I need to be able to have nodes inside a container and to be able to make nodes and/or containers dependent on other nodes and/or containers. I'm using subgraph to…
Winston Smith
  • 20,241
  • 10
  • 55
  • 74
94
votes
2 answers

Graphviz, changing the size of edge

How to change the size of edge in dot (graphviz)? I would like to make some edges "bolded".
name
  • 4,385
  • 4
  • 23
  • 35
84
votes
2 answers

Dot graph language - how to make bidirectional edges automatically?

Here is a very simplified example of my Dot graph: strict digraph graphName { A->B B->A } This creates Instead I want a single edge shown between A and B but with a double arrow head. I know how to get the double arrowhead as a global…
I82Much
  • 25,421
  • 13
  • 84
  • 117
68
votes
1 answer

Graphviz subgraph doesn't get visualized

I'm trying to create a graph with two subgraphs in dot. The code is as follows: digraph G { subgraph step1 { style=filled; node [label="Compiler"] step1_Compiler; node [label="Maschine"]…
halfdan
  • 31,036
  • 8
  • 73
  • 85
59
votes
1 answer

Graphviz: Putting a Caption on a Node In Addition to a Label

In my Graphviz graph (written in DOT), I want each node to have a label, but in addition to that, I want some nodes to have a small caption denoting some other unique value for that node. For example, if this were for a history diagram, a node's…
A. Duff
  • 3,576
  • 4
  • 33
  • 63
58
votes
3 answers

How to force node position (x and y) in graphviz

I am trying to force position of nodes. I have x and y coordinates of my nodes and its also directed graph. I can use the rank=same to handle row (y coordinate), but can't figure out how I can handle column (x coordinate).
user664947
  • 581
  • 1
  • 4
  • 4
57
votes
1 answer

Horizontal Trees in Graphviz

I've made a tree in the dot language, similar to the one here. Is there any way I could get the tree to expand to the right, instead of downwards (so the root node is on the left and children go along to the right).
Peter
  • 1,169
  • 2
  • 12
  • 24
54
votes
3 answers

How do I set the resolution when converting dot files (graphviz) to images?

I tried $ dot -Tpng rel_graph.gv > rel_graph.png but the resulting image has a very low quality.
Alexandru
  • 22,519
  • 17
  • 61
  • 78
48
votes
5 answers

Newline in node label in dot (graphviz) language

Does anyone know how to put newline in the label of the node? \n is not working - instead some new nodes appear.
M T
  • 838
  • 1
  • 8
  • 23
45
votes
2 answers

GraphViz Node Placement and Rankdir

I'm having very good luck with graphviz and have been able to make nearly every graph that I need. I'm trying to duplicate this: http://en.wikipedia.org/wiki/File:ICS_Structure.PNG as faithfully as I can. The bottom part of that graph all flows…
simusid
  • 1,754
  • 3
  • 15
  • 23
45
votes
3 answers

How do I place nodes on the same level in DOT?

I want to render several trees simultaneously and place all root nodes and all leaf nodes on the same level. Here's an example of what I'm trying to do. Root nodes A and X are on the same level, and so are leaf nodes B, D, and Z. I unsuccessfully…
Thalecress
  • 2,801
  • 9
  • 30
  • 43
45
votes
4 answers

How to control node placement in graphviz (i.e. avoid edge crossings)

I'm using graphviz (dot) to generate the graph you can see below. The node in the lower left corner (red ellipse) causes annoyance as its edges cross several edges of the adjacent node. Is there a way to restrain node placement to a certain area?
jnns
  • 3,848
  • 3
  • 35
  • 65
44
votes
6 answers

Family tree layout with Dot/GraphViz

I am trying to draw a family tree with Dot and GraphViz. This is what I currently have: # just graph set-up digraph simpsons { ratio = "auto" mincross = 2.0 # draw some nodes "Abraham" [shape=box, regular=1, color="blue"] ; "Mona" …
BioGeek
  • 19,132
  • 21
  • 75
  • 123
1
2 3
62 63