Linux command
fdp 命令
文本
复制后可按需替换文件名、目录或参数。
常用示例
Generate graph from
fdp -Tpng [graph.dot] -o [output.png]
Output SVG format
fdp -Tsvg [graph.dot] -o [output.svg]
Process from stdin
echo 'graph { a -- b }' | fdp -Tpng -o [output.png]
Set graph attributes
fdp -Gsize="10,10" -Tpng [graph.dot] -o [output.png]
说明
fdp is a Graphviz layout engine for drawing undirected graphs using a force-directed placement algorithm. It positions nodes by simulating physical forces between connected and unconnected nodes. The spring model algorithm treats edges as springs and nodes as charged particles. It iteratively adjusts positions until reaching equilibrium, producing aesthetically pleasing layouts for many graph types. fdp is suited for undirected graphs where node clustering and edge lengths should reflect graph structure.
参数
- -T _FORMAT_
- Output format: png, svg, pdf, ps, etc.
- -o _FILE_
- Output file.
- -G _ATTR=VALUE_
- Set graph attribute.
- -N _ATTR=VALUE_
- Set node attribute.
- -E _ATTR=VALUE_
- Set edge attribute.
- -K _LAYOUT_
- Override layout engine.
- --help
- Display help information.
FAQ
What is the fdp command used for?
fdp is a Graphviz layout engine for drawing undirected graphs using a force-directed placement algorithm. It positions nodes by simulating physical forces between connected and unconnected nodes. The spring model algorithm treats edges as springs and nodes as charged particles. It iteratively adjusts positions until reaching equilibrium, producing aesthetically pleasing layouts for many graph types. fdp is suited for undirected graphs where node clustering and edge lengths should reflect graph structure.
How do I run a basic fdp example?
Run `fdp -Tpng [graph.dot] -o [output.png]` in a terminal, then adjust file names, paths, flags, or remote targets for your system.
What does -T _FORMAT_ do in fdp?
Output format: png, svg, pdf, ps, etc.