[Tex/LaTex] Tikz backloop arrow

tikz-arrowstikz-pgf

I created a flow chart with boxes all lined up vertically. Now I want to draw an arrow from the last box to the first box. How can I do this, so that the arrow leaves the last box horizontally on the west side and arrives at the first box horizontally on the west side?

right now I get only errors or an arrow leaving horizontally but arriving vertically…

Best Answer

The way i use to solve problems like this is by adding an additional control point to guide the line on. The following code shows how to do this by your given vertical example:

\documentclass{standalone}
\usepackage{tikz}
\begin{document}
\begin{tikzpicture}
\node (n1) at (0,0) [draw]  {Node 1};
\node (n2) [draw, below of=n1] {Node 2};
\node (n3) [draw, below of=n2] {Node 3};

% Connectors
\draw [->] (n1) -- (n2);
\draw [->] (n2) -- (n3);
\draw [->] (n3.west) -| ++(-0.5,0) |- (n1.west);

\end{tikzpicture}
\end{document}

The value ++(-0.5,0) sets the relative control point coordinates the backarrow has to go through. Edit them to your needs or add some more.

The code results in:

result of example code

Hope this helps.