Ich habe zwei horizontal angeordnete Zustände und muss diese verbinden, also A -> B und A <- B. Wie kann ich die Kanten so anordnen, dass sie sich nicht überlappen und mein Diagramm nicht zu einem A <-> B wird, sondern so sichtbar ist, dass man voneinander navigieren und die Eingabenachricht darüber und darunter platzieren kann.
(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)
Ich habe versucht, ??? auf oben, unten, Biegung links=20, Biegung rechts=20 einzustellen, aber keine dieser Einstellungen führt zum gewünschten Verhalten ...
UPDATE: ok, hier der vollständige Code und noch etwas: Wie kann ich dafür sorgen, dass die Schleifen links und rechts nicht so groß sind?
\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}
Antwort1
Da die Verbindungslinien entgegengesetzte Richtungen haben, müssen Sie bend left=<value>
für beide Linien verwenden, nicht bend left
für die eine und nicht bend right
für die andere:
\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}