수평으로 배치된 두 가지 상태가 있고 이를 연결해야 합니다(예: A -> B 및 A <- B). 가장자리가 겹치지 않고 다이어그램이 A <-> B가 되지 않도록 가장자리를 배치하려면 어떻게 해야 합니까? 그러나 그 대신 서로 탐색할 수 있고 입력 메시지를 위와 아래에 배치할 수 있다는 것이 보입니다.
(APPEND_COL) edge[???] node[anchor=east,above,xshift=+3.0em]{delete column} (DELETE_COL)
(DELETE_COL) edge[???] node[anchor=east,above,xshift=+3.0em]{append column} (APPEND_COL)
나는 설정을 시도했다 ??? 위, 아래로, 왼쪽으로 굽히기=20, 오른쪽으로 굽히기=20이지만 이들 중 어느 것도 의도한 동작을 생성하지 않습니다.
업데이트: 좋아요, 여기 전체 코드가 있습니다. 그리고 또 다른 것은 어떻게 하면 루프를 왼쪽과 오른쪽으로 그렇게 크지 않게 만들 수 있습니까?
\begin{tikzpicture}[->,>=stealth']
% State: FULL_QR
\node[initial above,state,anchor=north] (FULL_QR)
{\begin{tabular}{l}
Recompute QR \\
\end{tabular}};
% State: Append column update
\node[state, % layout (defined above)
below left of=FULL_QR,% Position is to the right of FULL_QR
node distance=5.0cm, % distance to FULL_QR
anchor=south] (APPEND_COL) % posistion relative to the center of the 'box'
{%
\begin{tabular}{l} % content
Append column \\
\ \ QR update
\end{tabular}
};
% State: Delete column update
\node[state, % layout (defined above)
below right of=FULL_QR,% Position is to the right of FULL_QR
node distance=5.0cm, % distance to FULL_QR
anchor=south] (DELETE_COL) % posistion relative to the center of the 'box'
{%
\begin{tabular}{l} % content
Delete column \\
\ \ QR update
\end{tabular}
};
% State: Append column update
\node[state, % layout (defined above)
below right of=APPEND_COL, % Position is to the bottom of APPEND_COL
node distance=5.0cm, % distance to APPEND_COL
anchor=south] (APPEND_ROW) % posistion relative to the center of the 'box'
{%
\begin{tabular}{l} % content
Append row \\
\ \ QR update
\end{tabular}
};
% draw the paths and and print some Text below/above the graph
\path (FULL_QR) edge[bend right=20] node[anchor=west,above,xshift=-3.0em]{append column} (APPEND_COL)
(FULL_QR) edge[bend left=20] node[anchor=east,above,xshift=+3.0em]{delete
column} (DELETE_COL)
(APPEND_COL) edge[bend right=20]
node[anchor=west,below,xshift=-3.0em]{append row} (APPEND_ROW)
(DELETE_COL) edge[bend left=20]
node[anchor=east,below,xshift=+3.0em]{append row} (APPEND_ROW)
(APPEND_COL) edge[above]
node[anchor=west,above,xshift=+0.0em]{delete column} (DELETE_COL)
(DELETE_COL) edge[below]
node[anchor=east,below,xshift=+0.0em]{append column} (APPEND_COL)
(APPEND_COL) edge[loop left] node[anchor=west,above,yshift=+1.5em,xshift=+2.0em]{append column}
(APPEND_COL) (DELETE_COL) edge[loop right] node[anchor=east,above,yshift=+1.5em,xshift=-2.0em]{delete column}
(DELETE_COL);
\end{tikzpicture}
답변1
연결선의 방향이 반대이므로 한쪽 선과 다른 쪽 bend left=<value>
선이 아닌 두 선 모두에 사용해야 합니다 .bend left
bend right
\documentclass{article}
\usepackage{pgf}
\usepackage{tikz}
\usetikzlibrary{arrows,automata}
\usepackage[latin1]{inputenc}
\begin{document}
\begin{tikzpicture}[->,>=stealth']
% State: FULL_QR
\node[initial above,state,anchor=north] (FULL_QR)
{\begin{tabular}{l}
Recompute QR \\
\end{tabular}};
% State: Append column update
\node[state, % layout (defined above)
below left of=FULL_QR,% Position is to the right of FULL_QR
node distance=5.0cm, % distance to FULL_QR
anchor=south] (APPEND_COL) % posistion relative to the center of the 'box'
{%
\begin{tabular}{l} % content
Append column \\
\ \ QR update
\end{tabular}
};
% State: Delete column update
\node[state, % layout (defined above)
below right of=FULL_QR,% Position is to the right of FULL_QR
node distance=5.0cm, % distance to FULL_QR
anchor=south] (DELETE_COL) % posistion relative to the center of the 'box'
{%
\begin{tabular}{l} % content
Delete column \\
\ \ QR update
\end{tabular}
};
% State: Append column update
\node[state, % layout (defined above)
below right of=APPEND_COL, % Position is to the bottom of APPEND_COL
node distance=5.0cm, % distance to APPEND_COL
anchor=south] (APPEND_ROW) % posistion relative to the center of the 'box'
{%
\begin{tabular}{l} % content
Append row \\
\ \ QR update
\end{tabular}
};
% draw the paths and and print some Text below/above the graph
\path (FULL_QR) edge[bend right=20] node[anchor=west,above,xshift=-3.0em]{append column} (APPEND_COL)
(FULL_QR) edge[bend left=20] node[anchor=east,above,xshift=+3.0em]{delete
column} (DELETE_COL)
(APPEND_COL) edge[bend right=20]
node[anchor=west,below,xshift=-3.0em]{append row} (APPEND_ROW)
(DELETE_COL) edge[bend left=20]
node[anchor=east,below,xshift=+3.0em]{append row} (APPEND_ROW)
(APPEND_COL) edge[above, bend left=5]
node[anchor=west,above,xshift=+0.0em]{delete column} (DELETE_COL)
(DELETE_COL) edge[below, bend left=5]
node[anchor=east,below,xshift=+0.0em]{append column} (APPEND_COL)
(APPEND_COL) edge[loop left] node[anchor=west,above,yshift=+1.5em,xshift=+2.0em]{append column}
(APPEND_COL) (DELETE_COL) edge[loop right] node[anchor=east,above,yshift=+1.5em,xshift=-2.0em]{delete column}
(DELETE_COL);
\end{tikzpicture}
\end{document}