Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/jpa/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Graphviz:如何设置';默认值';箭式?_Graphviz_Dot - Fatal编程技术网

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
    }
}