Graphviz:如何设置“默认”箭头样式?
考虑这个 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];
”每个边连接?
编辑:仅供参考 - 杰西的回答不包含任何代码;我写了这个片段并将其放在此处 - 由于未知原因,主持人将其从此处剪掉并将其粘贴到杰西的答案中。
Consider this dot
language code:
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
}
}
In the above example, only the 1 -> 2
connection will have the arrowhead=normal,arrowtail=dot
style applied; all the other arrows will be of the "default" style.
My question is - how do I set the arrow style (for the entire subgraph - or for the entire graph), without having to copy paste "[arrowhead=normal,arrowtail=dot];
" next to each edge connection?
EDIT: Just for reference - the answer from Jesse didn't contain any code; I wrote that snippet and had it in this space here - for unknown reasons, a moderator cut it off from here and pasted it into Jesse's answer.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
使用 edge 属性语句,如 DOT 语言中所述文档。
Use the edge attribute statement, as stated in the DOT Language documentation.
就像您对节点所做的那样,但使用
edge
,例如edge[style=dashed]
Just like you did for nodes, but using
edge
, e.g.edge[style=dashed]