2013-06-07 5 views
3

아래 그림과 같은 방향 그래프를 생성하기 위해 DOT를 사용하고 있습니다. 나는 모든 가장자리가 남쪽 꼬리 날개와 북쪽 머리 꼬임을 가지기를 원합니다. 그래서 모든 가장자리는 노드의 바닥에서 시작하여 노드의 꼭대기로갑니다.DOT의 노드에서 가장자리를 이동 시키시겠습니까?

왼쪽 이미지에서 알 수 있듯이 노드 2에서 노드 4와 노드 6까지의 가장자리는 노드의 측면을 따라 직선으로 올라가고 멋지지 않습니다. 레이아웃을 라우트했으면 좋았을 것입니다. 노드에서 멀리 떨어져있는 가장자리 (오른쪽 이미지와 같습니다)

노드에서 노드를 라우팅하는 방법은 무엇입니까?

예 그래프 다음과 같이 위의 그래프

enter image description here

내 DOT 파일은 다음과 같습니다 당신은 노드와 가장자리 사이의 원하는 거리를 얻을 수 있었다

digraph g { 
graph [ 
    center=true, 
    nodesep=1.2, 
    ranksep="1.2 equally", 
    sep=6.2, 
    splines=polyline 
]; 
node [label="\N"]; 
0 [area=2, 
    fixedsize=true, 
    height=0.69444, 
    label=0, 
    margin=1.2, 
    shape=box, 
    width=1.3889]; 
1 [area=2, 
    fixedsize=true, 
    height=1.3889, 
    label=1, 
    margin=1.2, 
    shape=box, 
    width=1.3889]; 
0:s -> 1:n; 
2 [area=2, 
    fixedsize=true, 
    height=1.3889, 
    label=2, 
    margin=1.2, 
    shape=box, 
    color="blue", 
    width=1.3889]; 
0:s -> 2:n; 
3 [area=2, 
    fixedsize=true, 
    height=0.69444, 
    label=3, 
    margin=1.2, 
    shape=box, 
    width=1.3889]; 
0:s -> 3:n; 
4 [area=2, 
    fixedsize=true, 
    height=0.69444, 
    label=4, 
    margin=1.2, 
    shape=box, 
    color="red", 
    width=1.3889]; 
1:s -> 4:n; 
2:s -> 4:n; 
6 [area=2, 
    fixedsize=true, 
    height=1.3889, 
    label=6, 
    margin=1.2, 
    shape=box, 
    color="red", 
    width=1.3889]; 
2:s -> 6:n; 
5 [area=2, 
    fixedsize=true, 
    height=0.69444, 
    label=5, 
    margin=1.2, 
    shape=box, 
    width=1.3889]; 
4:s -> 5:n; 
4:s -> 6:n; 
7 [area=2, 
    fixedsize=true, 
    height=0.69444, 
    label=7, 
    margin=1.2, 
    shape=box, 
    width=1.3889]; 
5:s -> 7:n; 
6:s -> 7:n; 
6:s -> 2:n; 
7:s -> 7:n; 
8 [area=2, 
    fixedsize=true, 
    height=0.69444, 
    label=8, 
    margin=1.2, 
    shape=box, 
    width=1.3889]; 
7:s -> 8:n; 
} 

답변

5

등선 = 스플라인이있는 선이지만 가장자리 선이 직선이 아닌 곡선이됩니다. 이 유일한 해결로 나타나는

graph [ 
    center=true, 
    nodesep=1.2, 
    ranksep="1.2 equally", 
    sep=6.2, 
    splines=spline 
]; 

enter image description here

+0

덕분에, 답변으로 받아 들였다. – QAZ

관련 문제