Graphviz:如何设置';默认值';箭式?
考虑一下这个Graphviz:如何设置';默认值';箭式?,graphviz,dot,Graphviz,Dot,考虑一下这个dot语言代码: digraph graphname { subgraph clusterA { node [shape=plaintext,style=filled]; 1 -> 2 [arrowhead=normal,arrowtail=dot]; 2 -> 3 -> X2 -> 5; 6; 7; label = "A"; color=b
dot
语言代码:
digraph graphname {
subgraph clusterA {
node [shape=plaintext,style=filled];
1 -> 2 [arrowhead=normal,arrowtail=dot];
2 -> 3 -> X2 -> 5;
6;
7;
label = "A";
color=blue
}
}
在上面的示例中,只有1->2
连接将应用arrowhead=normal,arrowtail=dot
样式;所有其他箭头将为“默认”样式
我的问题是-如何设置箭头样式(对于整个子图或整个图形),而不必在每个边连接旁边复制粘贴“[arrowhead=normal,arrowtail=dot];
编辑:仅供参考-未包含任何代码;我写了那个片段,并把它放在了这里——不知什么原因,一位主持人把它从这里剪掉,粘贴到了杰西的答案中 使用边属性语句,如中所述
就像你对节点所做的那样,但是使用
edge
,例如edge[style=虚线]
Awesome-谢谢你的回答,@JesseW-接受参考:)顺便说一句,我刚刚发现这也解释了同样的问题:)注意:你也可以在命令行上这样做(即不修改点文件)通过添加命令行参数,如-arrowtail=dot
。更一般地说,-E
用于设置默认的边缘属性,-N
用于设置默认的节点属性,-G
用于设置默认的图形属性。感谢您的快速回答,@Fabian Steeg-接受@JesseW链接原因:)干杯!
digraph graphname {
subgraph clusterA {
node [shape=plaintext,style=filled];
edge [arrowhead=normal,arrowtail=dot];
1 -> 2 ;
2 -> 3 -> X2 -> 5;
6;
7;
label = "A";
color=blue
}
}