Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/google-sheets/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
如何在Graphviz中左对齐节点?_Graphviz_Dot_Graph Drawing_Circuit Diagram - Fatal编程技术网

如何在Graphviz中左对齐节点?

如何在Graphviz中左对齐节点?,graphviz,dot,graph-drawing,circuit-diagram,Graphviz,Dot,Graph Drawing,Circuit Diagram,我试图用graphviz显示数字电路网表 我正在诉诸: 记录表示输入/输出端口的形状 rankdir=LR,建议从左到右对齐 下面的代码工作正常。然而,在布局过程中,一些输入(这里是“i3”)可能未对齐:我希望i3与i1和i2一样左对齐 我该怎么做 digraph G { graph [rankdir = LR]; node[shape=record]; c1[ label="{ {<i1>i1|<i2>i2}| c1 | {<f>f} }"

我试图用graphviz显示数字电路网表

我正在诉诸:

  • 记录表示输入/输出端口的形状
  • rankdir=LR,建议从左到右对齐
下面的代码工作正常。然而,在布局过程中,一些输入(这里是“i3”)可能未对齐:我希望i3与i1和i2一样左对齐

我该怎么做

digraph G {
  graph [rankdir = LR];
  node[shape=record];
  c1[  label="{ {<i1>i1|<i2>i2}| c1 | {<f>f} }"];
  c2[  label="{ {<i0>i0}| c2 | {<out_0>out_0} }"];
  c3[  label="{ {<i0>i0}| c3 | {<out_0>out_0} }"];
  c4[  label="{ {<i0>i0|<i1>i1}| c4 | {<out_0>out_0} }"];
  i1;   i2;   i3;   f;   i1 -> c2:i0[ label="w(1)"];
  i2 -> c3:i0[ label="w(2)"];
  i3 -> c4:i1[ label="w(4)"];
  c1:f -> c4:i0[label="w(3)"];
  c2:out_0 -> c1:i1[label="w(5)"];
  c3:out_0 -> c1:i2[label="w(6)"];
  c4:out_0 -> f[label="w(7)"];
}
有向图G{
图[rankdir=LR];
节点[形状=记录];
c1[label=“{i1 | i2}| c1 |{f}}”];
c2[label=“{i0}|c2}{out_0}}”];
c3[label=“{i0}|c3}{out_0}}”];
c4[label=“{i0 | i1}| c4 |{out_0}}”];
i1;i2;i3;f;i1->c2:i0[label=“w(1)”;
i2->c3:i0[label=“w(2)”;
i3->c4:i1[label=“w(4)”;
c1:f->c4:i0[label=“w(3)”;
c2:out_0->c1:i1[label=“w(5)”;
c3:out_0->c1:i2[label=“w(6)”;
c4:out_0->f[label=“w(7)”;
}

只需指定i1、i2和i3共享相同的等级:

digraph G {
  graph [rankdir = LR];
  node[shape=record];
  c1[  label="{ {<i1>i1|<i2>i2}| c1 | {<f>f} }"];
  c2[  label="{ {<i0>i0}| c2 | {<out_0>out_0} }"];
  c3[  label="{ {<i0>i0}| c3 | {<out_0>out_0} }"];
  c4[  label="{ {<i0>i0|<i1>i1}| c4 | {<out_0>out_0} }"];
  i1;   i2;   i3;   f;   i1 -> c2:i0[ label="w(1)"];
  i2 -> c3:i0[ label="w(2)"];
  i3 -> c4:i1[ label="w(4)"];
  c1:f -> c4:i0[label="w(3)"];
  c2:out_0 -> c1:i1[label="w(5)"];
  c3:out_0 -> c1:i2[label="w(6)"];
  c4:out_0 -> f[label="w(7)"];

  {rank=same; i1; i2; i3}
}
有向图G{
图[rankdir=LR];
节点[形状=记录];
c1[label=“{i1 | i2}| c1 |{f}}”];
c2[label=“{i0}|c2}{out_0}}”];
c3[label=“{i0}|c3}{out_0}}”];
c4[label=“{i0 | i1}| c4 |{out_0}}”];
i1;i2;i3;f;i1->c2:i0[label=“w(1)”;
i2->c3:i0[label=“w(2)”;
i3->c4:i1[label=“w(4)”;
c1:f->c4:i0[label=“w(3)”;
c2:out_0->c1:i1[label=“w(5)”;
c3:out_0->c1:i2[label=“w(6)”;
c4:out_0->f[label=“w(7)”;
{rank=same;i1;i2;i3}
}