Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

Even though I just learned how to draw an arc, I have difficulties in drawing the arcs in the figure. Especially the arc from the second circle to the first one. If I do: \draw[bend left,->] (l2.south) to node [auto] (l1.north) (where l1 is the circle above, and l2 is the circle below), the line will cross the circles and make the picture not pretty.

So does anyone know how to draw the arc from l2 to l1? Another thing is I would like this arc goes from the south of l2, and points to the north-west of l1 (instead of north of l1)

Could anyone help? Thank you very much!

enter image description here

share|improve this question
add comment

1 Answer

up vote 4 down vote accepted

You'll need to define a support point for this. You can use the syntax +(<x>,<y>), which specifies a point relative to the starting point. In order to smooth the curve, you'll have to make sure that the in value of the path segment going into the support point, and the out value of the segment leaving the support point add up to 0. To adjust the path of the curve, you can play with looseness, in looseness and out looseness, which specify how "curvy" the path is.

By specifying an out and in angle for the first and last segment of the path, you can determine at what location the path leaves or enters a node. Alternatively, you could specify (<node name>.north west) to make the path start or end at the top left of a node, or use (<node name>.<angle>) to specify at what angle on the shape outline the path will start or end, with 0 pointing due east, 90 due north, etc.

\documentclass[a4paper]{article}

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

\begin{document}

\begin{tikzpicture}[every node/.style={draw,ellipse}]
  \node (A) {A};
  \node [below left=2cm and 0.5cm of A] (B) {B};
\draw[out=-90,in=90,->]  (A) to  (B);
\draw [->] (B)  to [out=-90,in=-90,in looseness=2.5] +(-1cm,1cm) to [out=90,in=135,out looseness=1.5](A);
\end{tikzpicture}

\end{document}

If you're not set on the path leaving node B from the south, but instead make it leave from south west, you can instead just write

\draw [->] (B)  to [out=-135,in=135,in looseness=1.5] (A);

share|improve this answer
    
Thanks for your reply, but your code does not compile, it gives an error Package tikz Error: ( expected.... –  SoftTimur Sep 2 '11 at 14:28
    
@SoftTimur: This works fine for me. Perhaps you are using an older version of the libraries. –  Peter Grill Sep 2 '11 at 23:53
    
That's weird, it compiles fine for me if I copy the whole code block into a new document. Are you using an old (pre 2.1) version of TikZ? You can check that by putting \listfiles in your preamble and checking the list near the end of the .log file. –  Jake Sep 3 '11 at 0:12
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.