How to avoid overlapping nodes in graphviz?
Asked Answered
P

2

18

I am trying to draw a graph with many nodes and edges.

However, the graph is becoming too clumsy, with nodes and edges overlapping. I tried (unsuccessfully), the following, all or combinations of these.

size = "12.0, 20.0!";
margin  = 0.0;
len = 1.0;

I am using neato to generate a png file.

The size specification did not even seem to work.

Any tips will be appreciated.

Pule answered 19/11, 2012 at 4:7 Comment(0)
K
13

Try using sfdp or fdp from the same graphviz package. This tools have two parameters K and repulsiveforce which control how far the nodes will be from each other.

Look here for further details

Knowledge answered 19/11, 2012 at 4:40 Comment(2)
Looks like the K and repulsiveforce parameters work like magic wands. Thanks a lot.Pule
K seems to have disappeared?Diderot
P
15

Try using SFDP using graph [ overlap=false ].

Psychro answered 23/1, 2015 at 16:53 Comment(2)
This does not provide an answer to the question. To critique or request clarification from an author, leave a comment below their post.Pyrargyrite
@Fireblade He did provide an answer - solved my problem with SFDP. I made a slight amendment to improve his answer.Linzy
K
13

Try using sfdp or fdp from the same graphviz package. This tools have two parameters K and repulsiveforce which control how far the nodes will be from each other.

Look here for further details

Knowledge answered 19/11, 2012 at 4:40 Comment(2)
Looks like the K and repulsiveforce parameters work like magic wands. Thanks a lot.Pule
K seems to have disappeared?Diderot

© 2022 - 2024 — McMap. All rights reserved.