1

I would like to create more than one label for one edge. The result I'm interested in looks like this:

enter image description here

Note that the edge {0,2} has two labels: e and z. One is above the edge, the other one - below. This is the exact outcome I want. How can I achieve this?

MatthewRock
  • 1,071
  • 1
  • 14
  • 30

1 Answers1

3

Have you tried

digraph G {
  graph [ splines = false rankdir="LR" ]
  a -> b [ label = "foo" ];
  a -> b [ label = "bar" ];
}

I've checked it using http://www.webgraphviz.com/

Result looks like

Two labels

Taken from stackoverflow question Graphviz, grouping the same edges

Community
  • 1
  • 1
Nick Roz
  • 3,918
  • 2
  • 36
  • 57
  • I haven't. When I get home I will try this method and get back to you. Thanks for the input! – MatthewRock Jul 13 '16 at 11:41
  • @MatthewRock, remember, it's just a trick to workaround this issue, [have a look at the documentation](http://www.graphviz.org/doc/info/attrs.html#d:splines). Still, it is really good question about the possibility to have multiple labels at once – Nick Roz Jul 13 '16 at 11:45
  • @MatthewRock, thanks for accepting answer, but I remind again that my solution is a trick. In case one day this feature will be implemented and someone will give better answer - reaccept it. Right now, unfortunately, I don't see another option – Nick Roz Jul 15 '16 at 13:00
  • I am aware of this. Unfortunately, this isn't the best solution either for edges that aren't horizontal but are more curvy or such, but still the average fix is better then no fix. – MatthewRock Jul 17 '16 at 11:28