Question

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 above is not working.

Was it helpful?

Solution

Use headport instead of arrowhead. Read the dot guide.

OTHER TIPS

"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

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;

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

"f" -> "t" [label=2 arrowhead=none]
"m" -> "d" [label=0 arrowhead=none]
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top