← 返回命令列表

Linux command

graphviz 命令

文本

复制后可按需替换文件名、目录或参数。

常用示例

Render DOT file to PNG

dot -Tpng [graph.dot] -o [graph.png]

Render to SVG

dot -Tsvg [graph.dot] -o [graph.svg]

Use different layout engine

neato -Tpng [graph.dot] -o [graph.png]

Render to PDF

dot -Tpdf [graph.dot] -o [graph.pdf]

Circular layout

circo -Tpng [graph.dot] -o [graph.png]

说明

Graphviz is a graph visualization toolkit that reads graph descriptions in the DOT language and renders them as images. Multiple layout algorithms handle different graph types, from hierarchical directed graphs to force-directed undirected layouts. The suite includes several layout programs (dot, neato, fdp, sfdp, circo, twopi) and utility tools for format conversion and graph manipulation.

参数

-T _format_
Output format: png, svg, pdf, ps, jpg.
-o _file_
Output file.
-K _engine_
Layout engine: dot, neato, fdp, sfdp, circo, twopi.
-G _name=value_
Set graph attribute.
-N _name=value_
Set node attribute.
-E _name=value_
Set edge attribute.

FAQ

What is the graphviz command used for?

Graphviz is a graph visualization toolkit that reads graph descriptions in the DOT language and renders them as images. Multiple layout algorithms handle different graph types, from hierarchical directed graphs to force-directed undirected layouts. The suite includes several layout programs (dot, neato, fdp, sfdp, circo, twopi) and utility tools for format conversion and graph manipulation.

How do I run a basic graphviz example?

Run `dot -Tpng [graph.dot] -o [graph.png]` in a terminal, then adjust file names, paths, flags, or remote targets for your system.

What does -T _format_ do in graphviz?

Output format: png, svg, pdf, ps, jpg.