开发者

How to change arrowhead type?

开发者 https://www.devze.com 2022-12-11 20:20 出处:网络
I want to simulate non-directional graphs with .dot. To that end, I want the arrowhead type to be \"none\". How do I set this?

I want to simulate non-directional graphs with .dot. To that end, I want the arrowhead type to be "none". How do I set this?

"f" -> "t" [label=2],[arrowhead=none]
"m" -> "d" [label=0],[arrowhead=none]

The ab开发者_StackOverflow中文版ove is not working.


"f" -> "t" [label=2, arrowhead=none]

For example:

digraph g {
  rankdir="LR";
  dpi=300;
  node[
    fontname="Arial",
    shape="square",
    fixedsize=false,
    width=1.809,
    style=rounded
  ];

  edge [
    arrowhead="none"
  ];

  Node1 -> Node2;
  Node2 -> Node3;
  Node3 -> Node4;
}


Another nice way is to use the 'dir' attribute:

   "f" -> "t" [label=2 dir=none]
   "m" -> "d" [label=0 dir=none]

See also http://martin-loetzsch.de/DOTML/dir.html


You can change the arrow head either locally or globally.

digraph G
{
    edge[arrowhead="odiamond"]; // Globally

    A -> B
    A -> C [arrowhead="vee"]; // Locally
    C -> D
    C -> E
}

You can test it on GraphvizFiddle

All possible values could be found Here


If you don't have to create a digraph, you can use a graph:

  1. Replace digraph { on the top of your dot file by graph {.
  2. Change your node relationships to: a -- b;


"f" -> "t" [label=2 arrowhead=none]
"m" -> "d" [label=0 arrowhead=none]


Use headport instead of arrowhead. Read the dot guide.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号