graphviz - fixed node positions

懵懂的女人 提交于 2019-12-18 16:31:54

问题


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?


回答1:


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!"




回答2:


Running it with -n option should do the trick.



来源:https://stackoverflow.com/questions/8309201/graphviz-fixed-node-positions

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!