graphviz - 如何更改Graphviz子图排名?

标签 graphviz dot

我希望子图 clusterCG 与 3 具有相同的等级(clusterCG 不应包含 3)

digraph G{
 rankdir = LR;
 node [shape = none]

 1->2->3->4[arrowhead=none]

 node [shape = ellipse]

 A->A2->A3;

 subgraph clusterCG{
  shape = rect;
  rank=same;
  A2;
  B;
  C;
  color=blue;
  label="C";
 }

 { rank=same; 1; A;}
 { rank=same; 3; CG;}
 { rank=same; 4; A3;}
}

enter image description here

CG 生成为具有等级 3 的独立节点。

我希望子图 clusterCG 的等级为 3。

最佳答案

使用不同的等级算法与“newrank=true”

 digraph G {
 newrank=true
 rankdir = LR;
 node [shape = none]

 1->2->3->4[arrowhead=none]

 node [shape = ellipse]

 A->A2->A3;

 subgraph clusterCG{
  shape = rect;
  rank=same;

  A2;
  B;
  C;
  color=blue;
  label="C";
 }

 { rank=same; 1; A;}
 { rank=same; 3; A2}
 { rank=same; 4; A3;}
}

关于graphviz - 如何更改Graphviz子图排名?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13041728/

相关文章:

python-3.x - 如何通过点文件可视化 Pyfst 传感器

graph - 点图语言-如何自动制作双向边?

graph - 子图之间的距离增加

macos - graphviz 有没有好的 IDE 或 WYSIWYG 编辑器?

graph - 可视化具有大约 500 个节点的二分图

linux - Graphviz 找不到任何字体

graphviz - 如何删除点语言中的文本(graphviz)

c++ - 从 Qt 应用程序运行命令行点程序不会产生任何输出,这是怎么回事?

python - `pydot` 调用 GraphViz 失败。请安装 GraphViz 并确保其可执行文件在 $PATH 中

linux - 如何在Linux中调用应用程序时链接库路径