0

无重叠选项(overlap=false)和定位(“-n2”命令行参数)不兼容。

strict graph {
  overlap=false;
  1 [label="", xlabel=<<FONT POINT-SIZE="7">1</FONT>>, shape=circle, style=filled, width=0.05, pin=true, pos="120.4,31.1!"];
  2 [label="", labelfontsize="5", xlabel=<<FONT POINT-SIZE="7">2</FONT>>, shape=circle, style=filled, width=0.05, pin=true, pos="73,35.5!"];
  3 [label="", labelfontsize="5", xlabel=<<FONT POINT-SIZE="7">3</FONT>>, shape=circle, style=filled, width=0.05, pin=true, pos="236.2,35.2!"];
  4 [label="", labelfontsize="5", xlabel=<<FONT POINT-SIZE="7">4</FONT>>, shape=circle, style=filled, width=0.05, pin=true, pos="350,100!"];
  5 [label="", labelfontsize="5", xlabel=<<FONT POINT-SIZE="7">5</FONT>>, shape=circle, style=filled, width=0.05, pin=true, pos="350,90!"];
  6 [label="", labelfontsize="5", xlabel=<<FONT POINT-SIZE="7">6</FONT>>, shape=circle, style=filled, width=0.05, pin=true, pos="350,80!"];
  1 -- 4 [arrowhead=none, shape=none];
  2 -- 5 [arrowhead=none, shape=none];
  3 -- 6 [arrowhead=none, shape=none];
}

当执行以下命令行时:

neato -n2 -Tpng -ographviz-overlap-test.png graphviz-overlap-test.dotty

我得到以下结果:

graphviz 重叠测试点文件

您知道生成与不重叠边相连的节点图的替代解决方案吗?

提前致谢,

4

1 回答 1

0

只要您告诉graphviz节点的确切位置,就没有机会避免与您正在使用的代码重叠。我已经手动交换了节点 1 和 2 的位置,并以这种方式重新排序了节点。我猜你是dotty用其他软件生成文件的,这是罪魁祸首。

strict graph {
  overlap=false;
  1 [label="", xlabel=<<FONT POINT-SIZE="7">1</FONT>>,
    shape=circle, style=filled, width=0.05, pin=true, pos="73,35.5!"];
    #                                                 ^^^^^^^^^^^^^^
  2 [label="", labelfontsize="5", xlabel=<<FONT POINT-SIZE="7">2</FONT>>,
    shape=circle, style=filled, width=0.05, pin=true, pos="120.4,31.1!"];
    #                                                 ^^^^^^^^^^^^^^^^^
  3 [label="", labelfontsize="5", xlabel=<<FONT POINT-SIZE="7">3</FONT>>, shape=circle, style=filled, width=0.05, pin=true, pos="236.2,35.2!"];
  4 [label="", labelfontsize="5", xlabel=<<FONT POINT-SIZE="7">4</FONT>>, shape=circle, style=filled, width=0.05, pin=true, pos="350,100!"];
  5 [label="", labelfontsize="5", xlabel=<<FONT POINT-SIZE="7">5</FONT>>, shape=circle, style=filled, width=0.05, pin=true, pos="350,90!"];
  6 [label="", labelfontsize="5", xlabel=<<FONT POINT-SIZE="7">6</FONT>>, shape=circle, style=filled, width=0.05, pin=true, pos="350,80!"];
  1 -- 4 [arrowhead=none, shape=none];
  2 -- 5 [arrowhead=none, shape=none];
  3 -- 6 [arrowhead=none, shape=none];
}

产生

在此处输入图像描述

于 2018-01-06T01:21:12.473 回答