在Dot(GraphViz)中的线之间连接弧

时间:2010-02-13 04:22:35

标签: graph graphviz dot

我必须为我的AI课程制作状态空间图,我希望使用GraphViz来制作它(比Dia快得多)。我似乎无法弄清楚如何做的一件事是如何进行“和”连接,这基本上是连接到同一节点的两条线之间的弧。这可能吗?

1 个答案:

答案 0 :(得分:1)

是。虽然没有明确的点语法,但这里的方式几乎总是如此:

# just graph set-up
digraph new_graph {
ratio = "auto"
mincross = 2.0

# draw some nodes
"001" [shape=box, regular=1, style=filled, fillcolor="#FCD975"] ;
"017" [shape=circle  , regular=1,style=filled,fillcolor="#9ACEEB"   ] ;
"007" [shape=diamond  , regular=1,style=filled,fillcolor="#FCD975"   ] ;
# the key line--creating tiny node w/ no label, no color
# i use this style because it mimics the 'midpoint' style used in Omnigraffle et al.
"LN01" [shape=diamond,style=filled,label="",height=.1,width=.1] ;

# draw the edges
"001" -> "LN01" [dir=none,weight=1] ;
"007" -> "LN01" [dir=none,weight=1] ;
"LN01" -> "017" [dir=none, weight=2] ;
}

alt text http://img121.imageshack.us/img121/2547/dotgvziv.png