# Draw an arc between 2 nodes and label it in TikZ

I have already drawn two ellipses l1 and l2, l2 is on the left below l1:

\begin{tikzpicture}
\node (l1) [ellipse, draw=black, fill=white!20, text=black, scale=0.8, text centered]{
$l_1$};
\node (l2) [ellipse, draw=black, fill=white!20, text=black, scale=0.8, text centered, below left=1cm of l1]{
$l_2$};
\end{tikzpicture}

I would like to draw an arc from the south of l1 to the north of l2 with a ->. The aim of drawing arc instead of a line is to make it prettier, so just a little radian will be fine, no need to be very accurate.

Does anyone know how to do it?

Also I would like to label the arc in its middle. The label, which is actually a word, will be ideally displayed horizontally.

-
Your code does not compile for me. What TiKZ libraries are you using? – Niel de Beaudrap Sep 2 '11 at 1:05
@Niel de Beaudrap: \usetikzlibrary{positioning,shapes,shadows,arrows,shapes.multipart} – SoftTimur Sep 2 '11 at 1:11
Thanks. Generally, you should post a complete working document in such cases, to avoid such confusion. (Especially where TiKZ is involved, which has more accessories than the proverbial Malibu Stacy doll.) – Niel de Beaudrap Sep 2 '11 at 1:14
By the way: fill=white!20 doesn't make much sense: You're mixing 20% white with 80% white, ending up with white. What would make sense would be fill=white!20!blue, which mixes 20% white with 80% blue, or fill=blue!20, which mixes 20% blue with 80% white. If you want to get a semi-transparent background, specify fill=white, opacity=0.2 – Jake Sep 2 '11 at 3:19

You can draw the the arc with an arrow tip by using \draw [bend right,->] (l1) to (l2);. The curvature can be specified using bend right=<angle>.

To add a label, you can add a node halfway along the path by inserting node [auto] {<text>} after to. The auto keyword makes sure that the text doesn't overlap the line. If you want the text on the other side of the line, you can add the keyword swap after auto. The distance along the path can be controlled using at start, very near start, near start (or the equivalent expressions with end), or by specifying a fraction using at=<pos>.

Note that you don't need to set text centered explicitly, as this is the default behaviour.

\documentclass[a4paper]{article}

\usepackage{tikz}
\usetikzlibrary{shapes.geometric,positioning}

\begin{document}

\begin{tikzpicture}
\node (l1) [ellipse, draw=black, fill=white!20, text=black, scale=0.8]{
$l_1$};
\node (l2) [ellipse, draw=black, fill=white!20, text=black, scale=0.8, below left=1cm of l1]{
$l_2$};
\draw[bend left,->]  (l1) to node [auto] {Link} (l2);
\end{tikzpicture}

\end{document}
-
I just posted antoher related question: draw a special arc from 1 node to another in tikz, could you please take a look if you want? – SoftTimur Sep 2 '11 at 2:36