ceoec
ceoec

Reputation: 203

Graphviz / dot label overlap with edge

I have a label that barely touch the edge, but there were plenty of space round it, is there anyway to make it not touching the edge in Graphiz? This is minor issue, but I have to redraw in powerpoint if cannot resolve by coding as my collaborator is very unhappy about this.. (Or I may export to JPEG and make changing in paintbrush)...

And we have to do this in black and white only so changing color would not help :(

enter image description here

minimal example: (the whole diagram is much more complex, and I have to put A E B in the same rank)

digraph "md" {
  rankdir=TB;
  size="8,8";
  node [fontname="Helvetica" fontsize=10 shape=box];
  edge [fontname="Helvetica" fontsize=10];
  center=1;
  {rank=min "A"}
   {rank=min "B"}
  {rank=min "E"}


  "A" -> "B" [label="0.55***", dir=both];

  "E" -> "B" [label="0.22" labeldistance="2"];

}

Upvotes: 0

Views: 3053

Answers (1)

stefan
stefan

Reputation: 3749

For the records - making the example minimal

digraph {
    { rank=same A -> B -> C }
    A -> C [label=AC]
}

gives

enter image description here

using xlabel instead of label may help (but seems to have side effects)

digraph {
    { rank=same A -> B -> C }
    A -> C [xlabel=AC]
}

gives

enter image description here

Upvotes: 3

Related Questions