在Graphviz中,自环边太短且难看。

4

我使用graphviz画了一张图片,请查看FSM。 我认为它很丑,因为自环边太短了。 边的属性“minlen”对我没有用。 我尝试了几个节点端口,但除了我的当前实现之外,它都显示成一团糟。你有什么聪明的主意吗? 代码在这里:

digraph finite_state_machine {
rankdir=LR;
size="8,2"
fontname="Verdana"
node [shape = doublecircle]; Idle;
node [shape = circle,nodesep = "2.0"];
Working:s -> Working:s [ label = "response[j]?" ,minlen = 50000];
Idle -> Working [ label = "boot" ];
Working:n -> Working:n [ label = "sendtx[i]!",minlen = 50000 ];
Working:e -> Working:e [ label = "qry!" ,minlen = 50000];

}


此外,字体属性对我不起作用。我在Windows中使用Graphviz。我已尝试修改/etc/fonts/fonts.conf如下:<dir>C:/Windows/Fonts</dir>。 - L.Doe
1个回答

1
在编程中,添加nodesep=1;会使循环结构更大,但不一定更美观。因此,可以使用此方法来改善:
digraph finite_state_machine {
  rankdir=LR;
  size="8,2"
  fontname="Verdana"
  node [shape = doublecircle]; Idle;
  node [shape = circle,nodesep = "2.0"];
  Working:s -> Working:s [ label = "response[j]?" ,minlen = 50000];
  Idle -> Working [ label = "boot" ];
  Working:n -> Working:n [ label = "sendtx[i]!" ];
  Working:e -> Working:e [ label = "qry!"];
  nodesep=1;
}

会产生类似以下的内容:

Dot 输出


网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接