水平に配置された 2 つの状態があり、それらを接続する必要があります (例: 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}