Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

graphviz - fixed node positions

I have a graph that is processed by neato and I'm adding new edges to it. However, I don't want that the old nodes to be moved. I want that neato computes the new positions of the new nodes and the old nodes stay in the same place.

strict graph {
    node0 [pos="1,2"];
    node1 [pos="2,3"];
}

and I add new edges:

strict graph {
    node0 [pos="1,2"];
    node1 [pos="2,3"];
    node1 -- node2 [len="3"];
    ...
}

I want to get the same positions on the old nodes. For example:

strict graph {
    node0 [pos="1,2"];
    node1 [pos="2,3"];
    node2 [pos="3,4"];
    ...
}

How can I do that?

like image 342
microo8 Avatar asked Nov 29 '11 10:11

microo8


1 Answers

You can pin a node's position by setting the node attribute pin=true.

Or put a '!' at the end of the pos attribute: pos="34,12!"

like image 110
Emden R Gansner Avatar answered Oct 02 '22 02:10

Emden R Gansner