Creating graphs#

DOT is a text format for representing abstract graphs, for example architecture.gv below:

“DOT” is not an abbreviation, just an all–caps name.

Replace graph with digraph and -- with -> to create a directed graph.

The last few lines of the DOT file were used to create an image suitable for inclusion in this book, and are completely optional. bgcolor = transparent; sets the background to be transparent rather than a fixed color. dpi = 300; sets the dots per inch to use to calculate the resulting image resolution. size = "8.5,11!"; creates an image scaled up to where either the width is 8.5", the height is 11", or both, at the given DPI.

The Graphviz package contains the dot tool which converts DOT files (usually with a .gv extension) to images:

-Tpng specifies the output format as Portable Network Graphics, a popular bitmap image format. Other output formats are documented in man dot. -Tsvg for Scalable Vector Graphics output is probably the most popular vector image format.


This page is a preview of The newline Guide to Bash Scripting

No discussions yet