Skip to content

How to view or work with Graphviz Dot files

Olzhas Rakhimov edited this page Jul 18, 2018 · 3 revisions


  1. Graphviz
  2. (Optional) xdot

Graph View

To view the generated graph dot files without converting to other formats.

$ xdot

Graph to Image Conversion

Here's how to convert a Graphviz dot file to PDF format.

$ dot -Tpdf -o graph1.pdf

Apply -O flag to automatically generate output file names from the input file names.

$ dot -T pdf -O  # The output file is

To run dot on files in directories and sub-directories recursively.

$ find directory_path -type f -name "*.dot" | xargs dot -Tpdf -O

To create output file names without .dot in the name.

$ find directory_path -type f -name "*.dot" -exec sh -c 'dot -Tpdf "${0}" -o "${0%.*}.pdf"' {} \;
You can’t perform that action at this time.