[Tex/LaTex] Angled self referencing arrows in sequence diagram

tikz-pgf

I am adapting an example of a sequence diagram I took form texample.net.
http://www.texample.net/tikz/examples/sequence-diagram/

Unfortunately I am having some difficulties.

How would I draw a self referencing arrow? I have attached a picture with a red arrow to symbolize what I am talking about.

How would I do that in Tex?enter image description here

Best Answer

Here now everything summed up as answer not as comment. Saw you got it with the relative coordinates.

Arrowheads:

For changing the arrowhead, you have to use

\usetikzlibrary{arrows}

in your preamble. See the following code example for the most arrow types

\documentclass[border=5mm, tikz]{standalone}
\usetikzlibrary{arrows}
\begin{document}
\begin{tikzpicture}
% All arrows also possible with 'reversed'
 \foreach \x [count=\i] in {to,
                            to reversed,
                            latex,
                            latex',
                            stealth,
                            stealth',
                            triangle 90,
                            triangle 60,
                            triangle 45,
                            open triangle 90,
                            open triangle 60,
                            open triangle 45,
                            angle 90,
                            angle 60,
                            angle 45,
                            hooks,
                            ),
                            ],
                            |,
                            *,
                            o,
                            diamond,
                            open diamond,
                            square,
                            open square,
                            left to,
                            right to,
                            left hook,
                            right hook} {
  \draw [<->, >=\x] (0,-\i/2) -- ++(1,0) node (2.5,-\i/2) [anchor=west, align=left] () {\scriptsize{\x}};
 }

 \foreach \x [count=\i] in {round cap,
                            butt cap,
                            triangle 90 cap,
                            triangle 90 cap reversed,
                            fast cap,
                            fast cap reversed} {
  \draw [<->, >=\x, line width=1ex] (4,-\i/2) -- ++(1,0) node (6.5,-\i/2) [anchor=west, align=left] () {\scriptsize{\x}};
 }
\end{tikzpicture}
\end{document}

TikZ Arrow Types

Labels:

For setting labels on paths you can use the following code:

 \draw (0,0) -- (2,0) node [midway, rotate=45, above] {Text goes here};

For your code you have to look where you want to place your label and possibly adjust your path definition. Example code to fit your problem:

\documentclass[border=5mm, tikz]{standalone}
\begin{document}
\begin{tikzpicture}
 \coordinate (start-coordinate) at (0,0);
 \draw [->] (start-coordinate) %
    --++ (1,0)   node [midway, above] {Text above} %
    --++ (0,-.6) node [midway, right] {Text right} %
    --++ (-.74,0) node [midway, below] {Text below};
\end{tikzpicture}
\end{document}

enter image description here

Hope this answers your questions.

Related Question