我试图复制使用Graphviz的这一数字列(在LaTeX中生成的数字):定影节点到使用的graphviz
做各种搜索和阅读,我已经成功远远得到这个:
我对获取超级和下标不感兴趣。如果我真的想要的话,我很确定我能确定这一点。我想要做的是确保节点都在3 x 3网格中,并且很好地对齐。正如你所看到的,我的产品没有对齐。我的代码如下。 (这个数字是R中使用制图包制作。
到目前为止,我已经使用[pos='1,1!',pin=true]
尝试,并在三个由三格递增位置索引,但它并没有改变结果的。
任何提示?
库(制图)
grViz(
"
digraph {
graph [overlap = true, fontsize = 10]
node [shape=circle]
Q11 [pos='1,1',pin=true]
Q21 [pos='2,1',pin=true]
Y1 [fillcolor=lightgray,style=filled,pos='3,1',pin=true]
Q11 -> Q21
Q11 -> Y1
Q21 -> Y1
node [shape = circle]
Q12
Q22
Y2 [fillcolor=lightgray,style=filled]
Q12 -> Q22
Q12 -> Y2
Q22 -> Y2
node [shape = circle]
Q13
Q23
Y3 [fillcolor=lightgray,style=filled]
Q13 -> Q23
Q13 -> Y3
Q23 -> Y3
{rank = same; Q11; Q12; Q13}
Q11 -> Q12
Q12 -> Q13
{rank = same; Q21; Q22; Q23}
Q21 -> Q22
Q22 -> Q23
}
",
engine = 'neato')
你可以尝试不同的内部和外部边缘的权重,例如, 'Q11→Q21→Y1 [权重= 2]'和'Q11 - > Y1 [权重= 1]'。结果让你更接近你想去的地方。但最终,手工布置非常容易。 ;) – lukeA