Graphviz: label on the left side

graphviz, label, orientation

Solution

There aren't many ways to change the position of the text of an edge label - you could try to add some extra empty spaces to label... Sometimes also double edges have the effect of having one label to the right, the other one to the left.

Still hacky, but at least repeatable, you may use a `headlabel` (or `taillabel`) and then use `labelangle` together with `labeldistance` to position the label where you'd like:

a -> b [
        headlabel="Label on the left side" 
        labeldistance=7.5 
        labelangle=75
       ]

With a little trial and error you may place the label where needed.

Problem

in case I use the following Graphviz code, a simple graph will be created which shows the label on the right hand side. ``` digraph lable_on_the_right_side { /* define nodes */ node [color=lightblue2, style=filled, fontname=Arial]; a [label="S1"]; b [label="S2"]; /* define edges */ a -> b [label="Label on the right side"] } ``` Is it possible to let the label appear on the left side instead? If yes, what would the code need to look like?

Original source