Dot: Difference between revisions
From charlesreid1
(Created page with "Dot is part of the Graphviz group of programs. It is similar in some ways to LaTeX, in that you start with a text document written with a particular syntax, and then run it thro...") |
|||
| (3 intermediate revisions by the same user not shown) | |||
| Line 35: | Line 35: | ||
Use the following command: | Use the following command: | ||
< | <pre> | ||
dot plot.dot -Tpng -o plot.png | dot plot.dot -Tpng -o plot.png | ||
</ | </pre> | ||
Alternatively, you can specify: | Alternatively, you can specify: | ||
< | <pre> | ||
dot plot.dot -Tpng -O | dot plot.dot -Tpng -O | ||
</ | </pre> | ||
which will use the name of the input file and change the extension to match the format (in this case, <code>plot.png</code>). | which will use the name of the input file and change the extension to match the format (in this case, <code>plot.png</code>). | ||
| Line 69: | Line 69: | ||
* Dot command line usage: http://www.graphviz.org/doc/info/command.html | * Dot command line usage: http://www.graphviz.org/doc/info/command.html | ||
* Graphviz documentation: http://graphviz.org/Documentation.php | |||
* Dot user's manual: http://graphviz.org/pdf/dotguide.pdf | |||
* Directed versus undirected: http://stackoverflow.com/questions/13236975/graphviz-dot-mix-directed-and-undirected | |||
** Summary: for undirected graphs use <code>graph G {</code>. For directed graphs use <code>digraph G {</code>. | |||
{{Programs}} | |||
Latest revision as of 07:46, 28 March 2017
Dot is part of the Graphviz group of programs.
It is similar in some ways to LaTeX, in that you start with a text document written with a particular syntax, and then run it through dot to process it and generate images (pdf, png, jpeg, etc) as the output.
Installation
Dot can be downloaded from here: http://graphviz.org/Download.php
Binaries for most platforms are provided, as well as source code.
Usage
Use the example dot file given below. This should be put in a file like plot.dot or something similar:
digraph G {
CFD
"Governing equations"
CFD -> "Governing equations"
"Discretization of governing equations"
CFD -> "Discretization of governing equations"
CFD -> "Fluid mechanics"
Turbulence
"Fluid mechanics" -> Turbulence
Turbulence -> "Turbulence modeling"
"Turbulence modeling" -> RANS
LES
"Turbulence modeling" -> LES
"Turbulence modeling" -> DNS
}
This file is written in "dot" syntax. Next, this file will be processed through dot. Two things must be specified: first, the format of the output image, and second, the output file.
Use the following command:
dot plot.dot -Tpng -o plot.png
Alternatively, you can specify:
dot plot.dot -Tpng -O
which will use the name of the input file and change the extension to match the format (in this case, plot.png).
Dot supports the following output formats:
- png
- gif
- ps
- svg
- svgz
- fig
and some less common formats:
- cmapx
- imap
- mif
- hpgl
- pcl
See http://www.graphviz.org/cvs/doc/info/output.html for more info.
References
- Dot command line usage: http://www.graphviz.org/doc/info/command.html
- Graphviz documentation: http://graphviz.org/Documentation.php
- Dot user's manual: http://graphviz.org/pdf/dotguide.pdf
- Directed versus undirected: http://stackoverflow.com/questions/13236975/graphviz-dot-mix-directed-and-undirected
- Summary: for undirected graphs use
graph G {. For directed graphs usedigraph G {.
- Summary: for undirected graphs use