【问题标题】:No-overlapping edges with positioned nodes与定位节点不重叠的边
【发布时间】:2018-01-06 15:49:23
【问题描述】:

无重叠选项(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 path-finding dot overlapping neato


    【解决方案1】:

    只要您告诉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];
    }
    

    产生

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2012-10-10
      • 1970-01-01
      • 2018-03-11
      • 2012-08-10
      • 1970-01-01
      • 2015-04-16
      • 1970-01-01
      相关资源
      最近更新 更多