Graphviz

Top / Graphviz

リンク

SYNOPSIS

dot -Tgif -o output.gif input.dot
# EPS を出力
(dot -Tps -o tmp.eps input.dot \
 && epstopdf --nogs tmp.eps --outfile=output.eps \
 && rm tmp.eps)

LaTeX/トラブルメモ#epstopdf 参照

単純な有向グラフ

digraph G
{
	// 横方向ならLR
	rankdir=TB;
	
	from -> to;
}

無向グラフ

graph G
{
	a -- b;
}

digraphで

edge [dir=none];

同列に並べる

A -> B;
{rank = same; A; B;}
10 -> 20 -> 30
{rank = same; 10 A B;}
{rank = same; 20 C;}
{rank = same; 30 D E;}
// 10刻みぐらいの方がBASICの行番号的に便利(死

応用

node [style=invis, label="", width=0];
edge [style=invis];

なものを作ってそれに併せてrank = same で並べると意図したとおりに並べやすい。
これでも若干マージンができる。

バグ

constraint=falseとrank=sameの組み合わせによってはセグメンテーション違反がでるのは 2.2.1-1の仕様らしい・・・。

矢印を消す

from -> to [arrowhead = none];

配置に影響を与えない

from -> to [constraint = false];

複数オプション

from -> to [arrowhead = none, constraint = false];

ノードの全体の形を変える

node [shape=point];

トップ   差分 バックアップ リロード   一覧 単語検索 最終更新   ヘルプ   最終更新のRSS
Last-modified: 2005-08-12 (金) 14:21:26 (6831d)