如何防止graphviz在标签上绘制边?
如果我在这个有向图上运行graphviz:如何防止graphviz在标签上绘制边?,graphviz,graph-drawing,Graphviz,Graph Drawing,如果我在这个有向图上运行graphviz: digraph G { subgraph cluster_0 { style=filled; color=lightgrey; node [style=filled,color=white]; a0; a1; a2; a3; label = "sources"; } subgraph cluster_1 {
digraph G {
subgraph cluster_0 {
style=filled;
color=lightgrey;
node [style=filled,color=white];
a0; a1; a2; a3;
label = "sources";
}
subgraph cluster_1 {
style=filled;
color=lightgrey;
node [style=filled,color=white];
b0; b1; b2; b3;
label = "intermediaries";
}
a0 -> b0; a1 -> b0;
a0 -> b1; a1 -> b1;
a2 -> b2; b0 -> b2;
b1 -> b2; a3 -> b3;
b0 -> b3; b1 -> b3;
}
我明白了
许多边缘与“中间人”标签相交。如何让graphviz使边缘避开标签?作为一种解决方法:
digraph G {
subgraph cluster_0 {
style=filled;
color=lightgrey;
node [style=filled,color=white];
a0; a1; a2; a3;
label = "sources";
}
subgraph cluster_1 {
style=filled;
color=lightgrey;
node [style=filled,color=white];
nodelabel [label="intermediaries"; style=filled; color=lightgrey]
nodelabel -> b1 [style=invis];
nodelabel -> b0 [style=invis];
b0; b1; b2; b3;
}
a0 -> b0; a1 -> b0;
a0 -> b1; a1 -> b1;
a2 -> b2; b0 -> b2;
b1 -> b2; a3 -> b3;
b0 -> b3; b1 -> b3;
}
制作:
这是一个解决办法,尽管它引入了一个额外的级别,并将标签放在该级别上,而我实际上并不想这样做。尽管如此,努力还是得到了+1。