Search code examples
windowsgraphvizdot

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)


Solution

  • Type

    dot -Tps filename.dot -o outfile.ps
    

    if you want to use the dot renderer. There are alternatives like neato and twopi. If Graphviz isn't in your path, figure out where it is installed and run it from there.

    You can change the output format by varying the value after -T and choosing an appropriate filename extension after -o.

    If you're using Windows, check out the installed tool called GVEdit, it makes the whole process slightly easier.

    Go look at the Graphviz site for more details on how to use the tools: https://www.graphviz.org/documentation/

    See section "Command Line Options" for output formatting for the dot command, for instance: https://www.graphviz.org/pdf/dotguide.pdf